Hi, I have the code in my urls.py for my generic views;
infodict = {
'queryset': Post.objects.all(),
'date_field': 'date',
'template_name': 'index.html',
'template_object_name': 'latest_post_list',
}
urlpatterns += patterns('django.views.generic.date_based',
(r'^gindex/$', 'archive_index', infodict),
)
So going to the address /gindex/ will use a generic view with the template of 'index.html'.
But since I will have more generic views in this urlpattern, how am I supposed to provide a different template name using the same infodict? I don't want to have to use lots of infodicts, and I can't use the default template name.
Please note this also applies to template object name within infodict.
Thanks for your help!
Edit: This is one of my first questions on stackoverflow and I am amazed with the thorough answers! I prefer using the dict constructor which I didn't know about. I find using the python documentation a bit harder as I can't find what i'm looking for usually!
Thanks again for all the answers and different approaches.