On Mon, 2007-11-05 at 11:47 -0600, Jeremy Dunck wrote:
> Consider:
> 
> class Place(Model):
>     ...
> 
> class Retaurant(Model):
>     place = ForeignKey(Place, unique=True)
>     ....
> 
> Currently, if you have a place reference and want to get to the (0 or
> 1) restaurant, you do something like this:
> 
>    r = place.restaurant_set.get()
> 
> Slightly more idiomatic w/ related_name
> 
>    r = place.restaurants.get()
> 
> I think it'd be nice to have this instead:
> 
>    r = place.restaurant

I think it would be bad to have that. Now you have reverse ForeignKey
relationships returning two different things, depending only on whether
it's unique or not. Inconsistent. I see this as the one argument for
keeping OneToOneField around: it will return the object.

So I'm -1 on this.

Malcolm

-- 
A conclusion is the place where you got tired of thinking. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to