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

As far as I can tell, this would be a one-line change to
ForeignRelatedObjectsDescriptor.__get__.

... I have the feeling I brought this up with someone before, but I
can't find the thread and might just be hallucinating.

--~--~---------~--~----~------------~-------~--~----~
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