Skip to content Skip to sidebar Skip to footer

Django/python : Sort Python's Dictionaries With The Equals Key

I am currently trying to sort two Python dictionaries into an HTML array such as: #Headers DictA = {'value': 'valeur', 'name': 'nom' } #Data DictB = {'value': '456', 'name': 'Test

Solution 1:

Here is the right answer :

<tr>
                  {% for cle, valeur in headersLoop %}
                  {% for cleVD, valeurVD in valuesData %}
                  {% if cle == cleVD %}
                  <td><p> {{cle}}{{valeurVD}} </p></td>

                  {% endif %}
                  {% endfor %}
                  {% endfor %}
                </tr>

I marked it as solved. And create a new topic. Thanks all.

Post a Comment for "Django/python : Sort Python's Dictionaries With The Equals Key"