Hi

On Wed, Jan 27, 2010 at 11:29 PM, Olivier Guilyardi <m...@xung.org> wrote:
> Hi,
>
> I'm working with a polyhierarchical thesaurus, and trying to handle that in
> Django. By polyhierarchical, I mean : nodes can have both multiple parents and
> children.
>
> Actually, this is a geographical thesaurus, and yes a location can have 
> multiple
> parents (being across countries, etc..).
>
> I have read about the Nested set paradigm [1], and would love to use that, 
> maybe
> through django-mptt or django-treebeard. But unless someone shows me how, 
> nested
> sets aren't suitable for polyhierarchical data.
>
> Currently I have a simple recursive many-to-many mapping. This allows to
> establish the poly-relations, but is completely unusable for real use cases.
>
> For instance, I have a table of "items", with a "location" field which points 
> to
> a location in the thesaurus.
>
> Now I need to list all items which are located in a given country.
>
> I just can't filter by country, there's no such field in the items table. And 
> a
> location can be of any level of precision, such as country, region, city,
> village, etc..
>
> The nested set would be perfect for this, but apparently can't handle multiple
> parents.
>
> Do you see a fast and elegant way to handle this ?
>
> [1] http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
>

Maybe you could take a look at this project?
http://bitbucket.org/cmutel/django-directed-acyclic-graph/


Matthias

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to