On Wed, 2007-10-03 at 12:40 -0600, staff-gmail wrote: > So my question was how do I do ORM in a view ??
See [1] where it explains how dotted references are mapped back to Python objects. > Where is "choice_set" > coming from ?? Based on the name and the examples shown, it's related to the one-to-many relation between the Choice and Poll models. To avoid having to put in annotations on both models, the reverse name is auto-generated. See [2] and [3] (the 'related_name' attribute in the latter case and links to the examples near there are good follow-ups, too). [1] http://www.djangoproject.com/documentation/templates/#variables [2] http://www.djangoproject.com/documentation/db-api/#backward [3] http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---