python - Django Dict of List Template -


this question has answer here:

i trying print out stuff dictionary of lists in django. here dict_:

defaultdict(<class 'list'>, {'uit energy producers class': [6, 3, '08-18-2017'], 'equity growth class': [18, 3, '08-18-2017'], 'unconstrained bond class': [13, 3, '08-18-2017']}) 

in views.py:

context['obj_items'] = dict_ return context 

then in templates.html:

    {% key, value_list  in obj_items.items %}         {% value in value_list %}             {{ value }}         {% endfor %}     {% endfor %} 

but nothing getting printed out. ideas?

use this:

dict(dict_) 

django template doesn't accept defaultdict


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -