On Tuesday 18 Aug 2009 7:27:58 pm Léon Dignòn wrote:
> Why should I use a ForeignKey if I want my user profile extended? If
> the reverse side will return a single object, I could spare a little
>
> bit of code, if I just write:
> >>> "User.objects.get(username='Leon').avatar"
>
> instead of
>
> >>> "u = User.objects.get(username='Leon')"
> >>> "UserProfileExtension.objects.get(user=u).avatar"

I think the reason is partially historical - at one stage the one2one field was 
going to be abolished and was quirky - so unique foreign key was a workaround. 
Possibly that does not hold now.
-- 
regards
kg
http://lawgon.livejournal.com

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to