I started writing a new model for a client's website. The easiest analogy I 
can make is something like a menu, so I wrote just that (start simple, then 
add the hard stuff).

<code>
from django.db import models

class Menu(models.Model):
    parent=models.ForeignKey(Menu)
    text=models.CharField(max_length=50)
    location=models.CharField(max_length=255)
    def __unicode__(self):
        return self.text
</code>

While this allows me to back-track up, when displaying, I want ordered 
lists (the actual ordering comes later, but that's easy enough). So 
basically, is there a way to find out what models reference a given object? 
So my template can pick "object number 1" and find all those that reference 
it as a parent, and move on down the line? Or would I be better off 
grabbing something like django-treebeard and using that? If the latter, is 
there some sample code beyond the "Basic Usage" in its documentation 
someone could point me to?

Thanks!

James C

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to