Hey, Thanks!; that's exactly what I was looking for, Adam
On 12/13/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > On 12/12/06, Adam Seering <[EMAIL PROTECTED]> wrote: > > > > Hi, > > I know Django keeps track of connections like this somehow, for > the > > *_set properties. Is there a way to get at that information > > somehow?, or does anyone have a better idea on how to do this? > > The details you are after are all stored in the _meta member of any > object/model. For example: > > article._meta.fields is the list of normal fields, including ForeignKeys > article._meta.many_to_many is the list of m2m fields > article._meta.get_all_related_objects() returns the list of all > related objects - i.e., the objects that have a foreign key on Article > article._meta.get_all_related_many_to_many_objects() returns the list > of all related m2m objects - i.e., the objects that define an m2m > field relating to Article. > > The implementaiton of lookup_inner() in query.py gives a good idea of > how to traverse relations using members of _meta. > > 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?hl=en -~----------~----~----~----~------~----~------~--~---