I have a model like
class Task(models.Model):
name = Models.CharField(max_length = 100)
parent = models.ForeignKey('Task', null = True)
Using this model say I have got a table like,
Task
-------
ID Name Parent_id
1 Foo null
2 Bar 1
3 Baz 1
4 Bax 2
I want to display this information hierchically in the template,
something like
<ul>
<li> Foo </li>
<ul>
<li> Bar</li>
<ul><li> Bax </li></ul>
<li> Baz </li>
</ul>
</ul>
Essentially I want to convert a relational data to monarchical data.
Does any body have snippets/recipe to do something similar? I am using
mySQL
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---