I have a model where the foreign key refers to it self.
parent = models.ForeignKey('self', core=True, null=True, blank=True)

What i want to do is to be able to run a query with select_related and
get all the parents of that row. When I run test =
content.objects.select_related().get(pk=3) and if I knew how many
parents there are I can get them all using test.parent then
test.parent.parent... etc.. But I need to be able to iterate though and
get the full list. Does anyone how I can do that?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to