I have the following hierarchical data structure making use of the datetime-object, dictionarys, arrays and tuples all at once.
{ datetime : { (datetime, datetime) : [<object1>,<object2>] } } So a dictionary, holding datetime objects as keys and another dictionary as value. The second dictionary has tuples consisting of two datetime objects as keys and an array as value. Reason for this complicated structure is the supposed easy handling in the template with three for-loops to iterate over the two dictionarys and the array. The first datetime object holds a specific day whereas the tuple is holding a time period. The array holds the objects related to the time period. So I used this in a template as following: {% for key,value in dictionary.items %} <h2>{{key|date:"Y-m-d"}}</h2> {% for key,value in value %} <h3>{{ key.0|date:"H.i" }} - {{ key.1|date:"H.i" }}</h3> {{ value }} // Array handling {% endfor %} {% endfor %} But the problem is, that inside the second for loop the key/value assignment does not work properly. I expected the tuple to be in key, so I can access it via key.0 and key.1 and the array to be in value. What actually happens is, that my first datetime object from the tupel is in key and the second datetime is in value but the array is nowhere to be found. Renaming the variables like key1,value1 had no effect. I start to think, that this might be a bug in django but I hope that I just missed something. Feedback is highly appreciated. (Using Django 1.0.2. final and Python 2.5.1.) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---