[Fixed]-Sending iterable object to base template (ex: ' menus = Menu.objects.all() ')

1👍

If you pass:

menus = Menu.objects.all()

you can use in your template:

{% for menu in menus %}
...

    {% if menu.sub_menu.exists %}
        {% for submenu in menu.sub_menu.all %}
        ....

You did already call .all() in your view.

Leave a comment