Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UserProfile(models.Model):
- description = models.TextField()
- class Channel(models.Model):
- subscribed = models.ManyToManyField(UserProfile,
- related_name="subscribed")
- c = Channel.objects.get(pk=1)
- subscribed = c.subscribed_set.all()
- not_subscribed = UserProfile.objects.exclude(pk__in=[s.pk for s in subscribed])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement