Hi!
I have following problem:
My application have 2 models:
1)
class ActiveList(models.Model):
user = models.ForeignKey(User, unique=True)
updatedOn = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.user.username
'''
GameClaim class, to store game requests.
'''
class GameClaim(models.Model):
me = models.ForeignKey(ActiveList, related_name='gameclaim_me')
opponent = models.ForeignKey(ActiveList, related_name='gameclaim_opponent')
In my view I took all ActiveList objects all = ActiveList.objects.all() and passed it to the template
In template I am looping through every item in the ActiveList, and create an xml file which is used on my client application.
the question is:
How can I query the info about the claims which one user (e.g. test, part of ActiveList), made to the user who is under loop
user2 e.g is taken like this
{% for item in activeList %}
{% endfor %}
user 2 is an item in this case