Hi All,
This is how I get this working..... (Thanks to Boris for the suggestion)
I have modified a the structure of the data from list of dictionaries to a
dictionary.
*#Now This is how the dictionary is printed in console*
{'25': {'socio': 'Randazzo Walter Ariel 25', 'enero': 'P', 'febrero': 'P',
'marzo': 'P', 'abril': 'P', 'mayo': 'P', 'junio': 'P', 'julio': 'P',
'agosto': 'P', 'septiembre': 'P', 'octubre': 'P', 'noviembre': 'P',
'diciembre': 'P'}, '31': {'socio': 'Silvi Edgardo Marcelo 31', 'enero':
'P', 'febrero': 'P', 'marzo': 'P', 'abril': 'P', 'mayo': 'P', 'junio': 'P',
'julio': '-', 'agosto': '-', 'septiembre': '-', 'octubre': '-',
'noviembre': '-', 'diciembre': '-'}}
*#This is how I populate the dictionary:*
dictinfopagosanual[nrosocio]={'socio':soc,
'enero':EneroPago,
'febrero':FebreroPago,
'marzo':MarzoPago,
'abril':AbrilPago,
'mayo':MayoPago,
'junio':JunioPago,
'julio':JulioPago,
'agosto':AgostoPago,
'septiembre':SeptiembrePago,
'octubre':OctubrePago,
'noviembre':NoviembrePago,
'diciembre':DiciembrePago,
}
*#Then I render in the template as follow:*
<tbody>
{% for key,value in pagos.items %}
<tr {% if forloop.first %}style="padding-top: 3px;" {% endif %}>
{% for key,value in value.items %}
<td class="text-center">{{ value }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
El vie, 14 may 2021 a las 19:59, Walter Randazzo (<[email protected]>)
escribió:
> Hi Boris,
>
> You're right it is a list of dictionaries. I thought that the template is
> not able to render the data structure I used.
>
> I will take a look on the link,thanks for the advice.
>
> Gracias Boris,
>
>
>
> El vie, 14 may 2021 a las 17:18, Boris Pérez (<[email protected]>)
> escribió:
>
>> Hi Walter, i think the matter is that your dictionary, is not a
>> dictionary, is a list of dictionaries (it looks more than json
>> object) perhaps u wanna use jquery and ajax, into your template...
>> Maybe this link is usefull to u
>>
>> https://stackoverflow.com/questions/51209582/django-dictionary-to-html-table-when-values-are-generators.
>> ..
>> Greetings, Boris
>>
>>
>> 2021-05-14 12:44 GMT-04:00, Walter Randazzo <[email protected]>:
>> > Hi Boris, Thanks for the reply.
>> >
>> > Here is the code:
>> >
>> > View:
>> > http://del.dog/mavihosuna
>> >
>> > Template:
>> > https://del.dog/mirfanelor
>> >
>> > Image of the rendered Template:
>> > https://tmpsee.com/v/nbkdqhnxee
>> >
>> >
>> > Regards,
>> >
>> >
>> >
>> >
>> >
>> > El vie, 14 may 2021 a las 11:57, Boris Pérez (<[email protected]>)
>> > escribió:
>> >
>> >> Where is the code, that u are using...
>> >> Si quieres igual hablamos en español...
>> >> Saludos...
>> >>
>> >> 2021-05-13 22:03 GMT-04:00, Walter Randazzo <[email protected]>:
>> >> > Hi Gabriel,
>> >> >
>> >> > I´ve just share the code via snippet to respect the identation of the
>> >> code
>> >> >
>> >> >
>> >> > El jue, 13 may 2021 a las 21:47, Gabriel Araya Garcia (<
>> >> > [email protected]>) escribió:
>> >> >
>> >> >> The links (image, code, and https://tmpsee.com/v/nbkdqhnxee) they
>> >> >> are
>> >> >> shit. It is impossible see it. Why you don't cut and paste here in
>> >> >> forum
>> >> >> page ?
>> >> >> Gabriel Araya Garcia
>> >> >> GMI - Desarrollo de Sistemas Informáticos
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> El jue, 13 may 2021 a las 20:22, Walter Randazzo
>> >> >> (<[email protected]
>> >> >)
>> >> >> escribió:
>> >> >>
>> >> >>> Here is how the dictionary is render out in the template:
>> >> >>> https://tmpsee.com/v/nbkdqhnxee
>> >> >>>
>> >> >>> thanks
>> >> >>>
>> >> >>> --
>> >> >>> 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/CAL7Dry7q1_WumJy1kKJROVD7xYFZ-2ie43LQMHJt0dLRQ9Lv0w%40mail.gmail.com
>> >> >>> <
>> >>
>> https://groups.google.com/d/msgid/django-users/CAL7Dry7q1_WumJy1kKJROVD7xYFZ-2ie43LQMHJt0dLRQ9Lv0w%40mail.gmail.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/CAKVvSDDqOqnGXWZcE8wZ6V%2B-Dzy1zCudBhpR406-5sJieRaefg%40mail.gmail.com
>> >> >> <
>> >>
>> https://groups.google.com/d/msgid/django-users/CAKVvSDDqOqnGXWZcE8wZ6V%2B-Dzy1zCudBhpR406-5sJieRaefg%40mail.gmail.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/CAL7Dry6v_yLMrAH8rGTmwYa8FQNgVtWmU8Rq56FF7bqCfuuPTg%40mail.gmail.com
>> >> .
>> >> >
>> >>
>> >> --
>> >> 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/CAObPVPCx_FJrD96d0vSWMt4V4eDAQ2ZA1%3D9vKm42Q-iqhG6f_g%40mail.gmail.com
>> >> .
>> >>
>> >
>> > --
>> > 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/CAL7Dry56TTF8%2BN7KB0-bPgdV6bn7RZLvGje9x-6rHjFmgY1RDg%40mail.gmail.com
>> .
>> >
>>
>> --
>> 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/CAObPVPBSTCCT7M95QzC9hMARE7Fzd0gkkGtJCjQryDJChHyCKA%40mail.gmail.com
>> .
>>
>
--
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/CAL7Dry6w2FfdOtT%2BG0VmnzuzXMm9eGS5dtS-MPdF4ddbPrnJ_Q%40mail.gmail.com.