An open API service indexing awesome lists of open source software.

https://github.com/davidar/django-recurse

Git mirror of the recurse template tag by Lucas Murray
https://github.com/davidar/django-recurse

Last synced: about 1 year ago
JSON representation

Git mirror of the recurse template tag by Lucas Murray

Awesome Lists containing this project

README

          

This repository is a packaged version of the recurse Django template tag
written by Lucas Murray.

Usage information according to

is replicated below:

Most of the tags are self explanatory, the only one that may cause
confusion is the main {% recurse %} one. The format for this tag is
{% recurse [children] with [parent] as [child] %} where "[children]" is the
property that contains the children of the current element, "[parent]" is
your starting element and "[child]" is the variable named used in the loop.

Here is an example of how you can implement a category tree using this
template tag. As you can see it’s fairly simple and with a couple of
modifications can be used for just about anything.

{% load recurse %}
... Headers and stuff ...
{% recurse category.category_set.all with categories as category %}


    {% loop %}

  • {{ category.title }}
    {% child %}

  • {% endloop %}

{% endrecurse %}
... The rest of the page ...