On Jan 25, 9:54 pm, "ben.bleik...@gmail.com" <ben.bleik...@gmail.com> wrote: > I am having an issue with Django 1.0.2 returning a list of blog posts > in my generic date based archive_index view. > > My URLs file looks like this: > > #Dictionaries > blog_dict = { > 'queryset': Entry.objects.all(), > 'date_field': 'pub_date', > 'template_object_name': 'entry', > }
<snip> > My model is called "Entry(models.Model): ..." > > My template is called entry_archive.html, looks like this: > > {% extends 'base.html' %} > {% block title %}The Blog{% endblock %} > > {% block content %} > > Hi > > {% for entry in entry_list %} > {% load markup %} > <h1>{{ entry.title }}</h1> > <p class="byline">{{ entry.pub_date }}</p> > {{ entry.content|textile }} > {% endfor %} > > {% endblock %} In your urls.py you have defined the template_object_name as 'entry'. However, in your template itself, you refer to 'entry_list'. template_object_name (assuming you are using Django version 1.0 or later) is used as the name for the list of objects within your template, so you should set this to entry_list rather than entry. -- 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---