On Thu, Feb 21, 2008 at 10:22 AM, shabda <[EMAIL PROTECTED]> wrote:
>
> 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
>
> [...]
>
> 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
Isn't just for this kind of cases that [1]django-mptt has beeen created?
--
Ramiro Morales
1. http://code.google.com/p/django-mptt/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---