On Apr 2, 7:08 pm, Jaap <[EMAIL PROTECTED]> wrote: > Still Greek to me... So far I did it like this: > > [view] > def start(request): > group = Staff.objects.values('pnr', 'last_name') > return render_to_response('tlist.html', group) > > [template] > <table> > {% for person in group %} > <tr> > <td>pnr</td> > <td>last_name</td> > </tr> > {% endfor %} > </table> > > Where did I go wrong?
The view return should be: return render_to_response('tlist.html', {'group':group}) And in your template, inside your loop, you should have: <td>{{person.pnr}}</td> <td>{{person.last_name}}</td> In fact you don't really need to use .values here, Staff.objects.all() would work just as well. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---