search through related field for specific related object
- by dotty
Hay, I'm working on a simple voting system, where users can vote on a poll.
My model looks like this
class Poll(models.Model):
question = models.CharField()
votes = models.IntegerField()
usersVoted = models.ManyToManyField(User)
Now, i want to scan through the usersVoted field to see if a User object is in there. This User object…