Hi,
i implemented a many-to-many field in my model like:
class Entries(models.Model):
following_to = models.ManyToManyField('self', blank=True, null=True)
Now i can get all related Entries in a template with entry.following_to.all.
But i want to go deeper in relationships.
Lets say i have 4 Entries A, B, C, D.
A is following_to to B and
B is following_to to C and
C is following_to to D.
A.following_to.all gives back B.
But what i need is to follow until the end of the chain is reached.
I need something like:
A.following_to.give_all_related_entries which then returns:
B, C, D
Do i have to write my own template tag for that or is it already implemented
in Django?
Or maybe there is a better approach to solve my issue?
I couldnt find a similar question or answer in the docs.
Greetings
Sven
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---