On Wed, 2007-03-14 at 04:20 -0700, DuncanM wrote:
> Thank you for the pointer Malcom,
> however you are only using 2 tables/classes (Player which is directly
> related to Match)
> The problem I am having is because I am using 3 tables/classes (Team
> is related to fixture, Fixture is related to Result) so I do not know
> how to get around that without having to duplicate data in my result
> table (e.g. repeating the information such as home team, away team,
> date, venue) etc.  Which I am trying to avoid as much as possible
> because the data wouldn't be normalised.

Grabbing information from three models is no harder than from two. Just
create the models exactly as you describe. Probably a couple of foreign
keys from Fixture to Team (one for each team) and another ForeignKey
from Fixture to Result (or vice-versa). QuerySets in Django allow you to
traverse multiple relations in one key. So just try it and see.

If you are still having problems, it will be a lot easier to help you if
you have attempted to create some models so that we can point to
specific lines of code. At the moment, it is a bit too up in the air to
see exactly where you are having problems.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to