Hi all!
While reevaluating my own historically old models I came to a dilemma
to which model it is better to set the ForeignKey when you want to
define ManyToOne relationship to a person. Should the ForeignKey point
to django.contrib.auth.models.User or to the one which is defined in
AUTH_PROFILE_MODULE.
Let's say there are songs CREATED BY someone, PLAYED BY someone,
UPLOADED BY someone.. How would you define that?
Like this:
class Song(models.Model):
author = models.ForeignKey(User, ...)
players = models.ManyToManyField(User, ...)
uploaded_by = models.ForeignKey(User, ...)
...
or like that:
from people.models import Person
class Song(models.Model):
author = models.ForeignKey(Person, ...)
players = models.ManyToManyField(Person, ...)
uploaded_by = models.ForeignKey(Person, ...)
...
?
With the first approach you could change the AUTH_PROFILE_MODULE at
any time. And with the second one you could change the authentication
mechanism easier or allow records of people without Users. What do you
usually choose?
Kind regards,
Aidas Bendoraitis
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---