On Tue, 18 Feb 2014 18:14:59 -0800 (PST), Mike Formica
<mformica71@gmail.com> declaimed the following:
>I am creating a simple baseball app. I am stuck with my model to allow a team to have multiple players with multiple fielder rankings. For example player 1 is on Team A with a short stop rank of 2 but that same player on Team A could be a first baseman with a rank of 4. Can anyone help give me some clues on how to approach this. Thanks so much!
Off-hand, given your description, I don't see a many-to-many
association.
One-to-many appears the model (one player, many position/rankings).
That assumes the player only appears on one team:
TEAM (name, etc.)
PLAYER(name, whatever, reference TEAM) [1 team->many player]
POSITION(title, rank, reference PLAYER) [1 player->many position]
OTOH, if you need to track a player over time, possibly changing teams,
you are talking an intersection table
TEAM(name, etc.)
PLAYER(name, whatever) [no reference to team]
POSITION(title, rank, start date, end date, reference player, reference
team) [many teams<>many players]
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9jb8g95jrqm4gin31ogcep8peikrd9gch2%404ax.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment