views:

26

answers:

2

I have a model in wich i'm using m2m Django ORM feature, in order to create an aditional table to hold my 'classrom members'. My problem is: the membership to a classroom must be accepted by the invited one, so i need a boolean field :1=accepted, 0=refused/unseen yet. How can i include this boolean variable in the aditionally generated classroom_membership (and NOT in the primary created Classroom table)?

 class Classroom(models.Model):
     user = models.ForeignKey(User, related_name = 'classroom_creator')
     classname = models.CharField(max_length=140, unique = True)
     date = models.DateTimeField(auto_now=True)
     open_class = models.BooleanField(default=True)
     #domain = models.EnumField()
     members = models.ManyToManyField(User,related_name="list of invited members")

Thanks in advance!!

+2  A: 

Extra fields on many-to-many relationships.

Daniel Roseman
Thank you! though i've read the documentation, i wasn't able to "make the connections". guess is about my bad English skills. thanks again!
dana
+1  A: 

Create your own through table.

Ignacio Vazquez-Abrams
thank you very much!
dana