> > [...] > > Let's say I have two models and in each I have field with ForeignKey > > relating to field in other model (hope it's clear). [...] >
Actually, I'm pretty confused about this part :) A ForeignKey is used to relate to another Model -- not just a Model Field -- in Django's ORM. So for example, if you have a Team Model and a Player Model, you'd want to include "team = models.ForeignKey(Team)" in your Player Model. If you want to back-reference this from your Team, this is also possible (just look through the docs). You don't need to declare the ForeignKey relationship twice. Finally, when you want a specific field from the other Model (for example, maybe a team's name) then you'd just query accordingly: my_player.team.name -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.