Having these models on google app engine:
class Choice(db.Model):
poll = db.ReferenceProperty(Poll, collection_name = 'choices' )
text = db.StringProperty()
class Vote(db.Model):
choice = db.ReferenceProperty(Choice, collection_name = 'votes' )
ip = db.StringProperty()
date = db.DateTimeProperty(auto_now=1)
How do I do this django query?
same_vote = Vote.filter(ip=self.ip, choice__poll=self.choice.poll)