I usually make link to User model not profile. And have no problems with usage.
On Apr 18, 2:02 pm, andy baxter <[EMAIL PROTECTED]> wrote: > Hello, > > I have built a data model for a virtual library, which contains the > following classes (among others): > > User - the built in user class from django.contrib.auth. > Member - a profile for each user, containing extra information about > each member. > Item - a book, video, or music album > Iteminstance - a specific copy of an item. > > I am thinking about what is the best way to structure this data - in > particular if ForeignKey fields from other tables (like iteminstance) > should refer to the Member table or the User table. At the moment I have > it like this: > > Member.user -> User > ItemInstance.owner -> Member > ItemInstance.item -> Item > > But I'm not sure about the second of these - should it be > ItemInstance.owner->User? > > I'm getting the feeling as I'm starting to write the code dealing with > Members and Users that making the right choice here could be important, > so as not to have to end up writing unnecessarily tangled code as the > model develops in the future (e.g. if I add 'Review' which refers to an > Item and is made by a Member/User). > > Has anyone dealt with this problem in practice, and do people have any > thoughts about what is the best way of doing things here, from the point > of view of keeping the code simple, and also minimising the time spent > doing database lookups? (I'm guessing that looking up a User from a > Member is slightly quicker than looking up a Member from a User). > > andy --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---