On 8/23/06, Burhan <[EMAIL PROTECTED]> wrote:
You pretty much have it. Model.m2mfield.all() (or filtered as appropriate) is the way you traverse m2m relations. If you're dealing with ForeignKeys there are a few things you can do to pre-cache query results (see select_related), but these techniques don't apply to m2m fields.
Yours,
Russ Magee %-)
I would appreciate if you could tell me a better way to get the m2m
relationship pulled in -- as the rest of the comments regarding the
template are something that I am well aware of. Also, by better design
-- I didn't mean better design for the database, I meant better design
in the sense a more django-way of getting that information out.
You pretty much have it. Model.m2mfield.all() (or filtered as appropriate) is the way you traverse m2m relations. If you're dealing with ForeignKeys there are a few things you can do to pre-cache query results (see select_related), but these techniques don't apply to m2m fields.
Yours,
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---