django-many-to-many

Checking another field at the same time as checking a many-to-many relationship.

I have a simple-ish ownership design on one of my models. It can be owned by multiple people and current owners can add other people but they have to confirm the invite before they are treated as a real owner. class MyOwnedThing(models.Model): owners = models.ManyToManyField(User, through='Ownership', related_name='othings') de...

Django ManyRelatedManager filtering based on through class

I have a simple many-to-many relationship based around a through class. class Person(models.Model): friends = models.ManyToManyField('self', through='Friendship') class Friendship(models.Model): me = models.ForeignKey(Person) them = models.ForeignKey(Person) confirmed = models.BooleanField(default=False) This should, ...