On Apr 25, 2008, at 3:40 PM, Marty Alchin wrote:

> *snip*
> class AuthorProfile(models.Model):
>    user = models.OneToOneField(User)
>    pen_name = models.CharField(max_length=255)

Now that QSRF has landed, this type of thinking leads me to: who's  
working on 121-rewrite?  And more importantly, can I offer my  
assistance? :)

Things like this would be well served by being able to follow a  
OneToOneField in both directions via a .select_related() (no extra  
trip to the DB).  We have several use cases, among them our own User  
system based on django.contrib.auth, in which we currently use almost  
exactly what you see above as our "extended profile" that would be  
very useful to have the relationship work in both directions in queries.

I will hesitantly say too, *if* OneToOneFields were to work that way  
and only generate a single query no matter which way they were  
approached (and followed all the proper ForeignKeys on both sides), I  
think it would end a good portion of the confusion/arguments about the  
proper design patterns to use here, since the only major justification  
left for not using the 121 mechanism would be on the saving side at  
that point.

gav

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to