Answer the question
In order to leave comments, you need to log in
How to use methods in templates in django?
There is a model with a method that returns a queryset with one argument. How can I use this method in a template?
def get_relative_children(self, level):
result = self.get_descendants().filter(level=self.get_level() + level)=
{% for child in get_relative_children(1) %}
<p> {{ child.id }} </p>
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question