0๐
โ
I figure out!
So regroup
could be nested and my code should be looks like something like this:
{% regroup datas by pagenum as pagenum_list %}
{% for pagenum in pagenum_list %}
<TAGS>
<PAGE page="{{pagenum.grouper}}">
{% regroup pagenum.list by parenttag as parenttag_list %}
{% for parenttag in parenttag_list %}
<PARENT parent="{{parenttag.grouper}}">
{% regroup parenttag.list by tag as tag_list %}
{% for tag in tag_list %}
<TAG>{{tag.grouper}}</TAG>
{% endfor %}
</PARENT>
{% endfor %}
</PAGE>
</TAGS>
{% endfor %}
๐คShun
1๐
either have your data structure better ready for rendering by grouping parents or implement a more advanced solution like Can I use XSLT in Django?
๐คGuy Gavriely
- [Answer]-What is wrong with my custom model field?
- [Answer]-Django queryset update performance and optimization
- [Answer]-Django Admin filter changelist by user
- [Answer]-What is a keyword argument in python?
- [Answer]-Server internal error with mod_wsgi and apache2
Source:stackexchange.com