I was also thinking of a better solution.
I have a Gig model which contains gigs with a ForeignKey to Artist.
I have a Artist model which contains artists.
One Gig can have multiple artists.
So instead of creating a field that is unique for each Gig (which might occur more then once since each gig might have more the one artist) I was thinking of the following.
Create a model GigArtist (and leave the Artist Foreign key out of the Gig model).
This model contains two fields one who references to a specific gig and one that references to a (or more then one) specific artist.
Op 25-jan-2011, om 16:20 heeft Shawn Milochik het volgende geschreven:
> Do you have 'unique = True' in the field definition in the model?
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
Met vriendelijke groeten,
Jonas Geiregat
jonas@geiregat.org
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment