Juan Hernandez wrote: > it does not return any values. > > I did post.0.title because the dictionary is established like this: > > >>> test > {0: {'post': 'My First Post', 'title': 'My First Title'}, 1: {'post': > 'My Second Post', 'title': 'My Second Title'}} > > and it goes on and on > > If I could iterate over it, like post.0.title, then post.1.title and so > forth, it would be perfect > > Thanks for your help Don't construct dict like that, make a list instead. [ {'post': 'My First Post', 'title': 'My First Title'}, {'post': ... ]
Or, if you don't have control over dict construction, munge it into list. If order isn't important: list_o_dicts = dict_that_should_be_list.values() If order is important: list_o_dicts = [ dict_that_should_be_list[k] for k in sorted(dict_that_should_be_list.keys()) ] Then you can use the template for loop construct normally {% for dict in list_o_dicts %} {{ dict.post }} {{ dict.title }} {% endfor %} -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___________________________________________________________________________ You've got fun! Check out Austin360.com for all the entertainment info you need to live it up in the big city! --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---