Hi, Thx for the hint...works like a charme :-)
Kind regards . . . . . . . . . . . . . . . . . . . . . . . . . . Patrick Szabo XSLT Developer LexisNexis Marxergasse 25, 1030 Wien mailto:patrick.sz...@lexisnexis.at Tel.: +43 (1) 534 52 - 1573 Fax: +43 (1) 534 52 - 146 -----Ursprüngliche Nachricht----- Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Matias Aguirre Gesendet: Donnerstag, 10. März 2011 14:42 An: django-users Betreff: Re: acces to dict Hi The problem is that django template system tries __getkey__ first and as you are using a defaultdict get key call is creating a new entry with key "items" and empty list as value. Try passing dict(prod_pool) to your template. Regards, Matías Excerpts from Szabo, Patrick \(LNG-VIE\)'s message of Thu Mar 10 11:28:00 -0200 2011: > Hi, > > > > I'm passing a dict of lists on to a template like this: > > > > return render_to_response('reports.html', {'produkte': prod_pool} > ,context_instance=RequestContext(request)) > > > > prod_pool looks like this: > > > > defaultdict(<type 'list'>, {'Dumme G\xc3\xa4nge revisited': > ['Absatzkontrolle'], 'Das Sparschwein im Wandel der Zeiten': > ['Konvertierungsanleitung', 'Sonstiges'], 'Schlager 1': > ['Konvertierungsanleitung'], 'RWZ 1': ['Absatzkontrolle', > 'Konvertierungsanleitung'], 'RWZ 3': ['Absatzkontrolle', > 'Konvertierungsanleitung']}) > > > > In my template i do this: > > > > {% for produkt, akt in produkte.items %} > > <h2>{{ produkt }}</h2> > > <table border=0> > > <tr> > > <th>Aktivitaet</th> > > <th>Zeit</th> > > <tr> > > <tr> > > {% for x in akt%} > > <td>{{ x }}</td> > > {% endfor %} > > </tr> > > <tr> > > <td><b>Gesamt: </b></td> > > <td><b> </b></td> > > </tr> > > </table> > > {% endfor %} > > > > Unfortunately i don't get a single table... > > Can anyone help me ?! > > > > Kind regards -- Matías Aguirre <matiasagui...@gmail.com> -- 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. -- 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.