You could do something like:
{% for key, value in my_dictionary.items %}
{{ key }} - {{ value }}
{% endfor %}
or like:
{% for value in my_dictionary.values %}
{{ value }}
{% endfor %}
Em dom., 21 de jun. de 2020 às 15:01, 'MH' via Django users <
[email protected]> escreveu:
> Hi
>
> I have context variable "convar". And this convar consists of a dictionary.
>
> So, it might look like:
>
> convar
> |-------- General case
> |
> |--------- Speical case A
> |
> |----------Special case B
>
> So, the general case and the special cases are the keys. And there values
> are lists. And in these lists I have several objects from the database, e.g.
>
> {'General case': [<Object: Object A>, <Object: Object B>, and so on]}
>
> Right now, I am just confused how to get to the single objects in a django
> template and there fields like Object A.object_field.
>
> I only get the name of the keys of the dictionary by using something like
> {% for key_var in convar %} {{ key_var}} {% endfor %}
>
> Can you tell me how to correctly get to the values of the objects? :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2099c7a7-abdd-42f2-91a3-bd9b2b3b8478o%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2099c7a7-abdd-42f2-91a3-bd9b2b3b8478o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CABKtLKB8Q4tmC64A8U-wnJ4vHiBXjYBNS8rWSE%2BW5HGXGMZg%2Bw%40mail.gmail.com.