antrod,

> If I've got a Many2Many relationship implemented via an intermediary
> table (a la
> http://www.djangoproject.com/documentation/models/m2m_intermediary/)
> but in the intermediary table I point back to the same table twice,
> does django's ORM not support this?
> 
> Example: table Node, intermediary table Relationship that wants to
> point back to Node twice (once as attribute 'child' and once as
> attribute 'parent'). It seems like what I get is the ability to see
> just one of the references back (the first one declared in the model
> object), so with a call like
> Node.get_relationship_list(parent__id__exact=x) I get nothing even if
> it is there.

It is supported, but badly documented. You have to use the 'singular'
attribute when defining the ManyToMany field.  Some docs are on this
page:

http://code.djangoproject.com/wiki/ModelSyntaxChangeInstructions

Luke


-- 
"Idiocy: Never underestimate the power of stupid people in large 
groups." (despair.com)

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

Reply via email to