Hi all
Does anyone know how to do something like this :
class Game(models.Model):
team1 = models.ForeignKey(Teams, related_name=u'team_home')
team2 = models.ForeignKey(Teams , related_name=u'team_away')
round = models.ForeignKey(Round)
game_date = models.DateField()
def __unicode__(self):
return Teams.objects.filter(self.team1) <<<<<<<< DOES NOT
WORK
Basically I want __unicode__ to return Teams.name based on the foreign
key reference
thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---