﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3667	Useful optional argument for generic views	sasch.pe@…	Jacob	"Hello everybody, i played a bit with generic views and thought, that it would be useful to have a 'template_base' optional argument. If you want to pass a custom template to a generic view, you currently have to add a 'template_name' argument to the parameter dictionary. For example, i have an app called 'blog' with a template-folder inside, Django has no problem with that, but the default generic views want to see my html-files in 'blog/templates/blog/'. So, when i provide something like this:

{{{
#!python
info_dict = {
    'queryset' : Spam.objects.all(),
    'date_field' : 'pub_date',
}
}}}

i would like to have that:

{{{
#!python
info_dict = {
    'queryset' : Spam.objects.all(),
    'date_field' : 'pub_date',
    'template_base' : 'templates',
}
}}}
This would simplyfy my URLconfs, currently if have to do a

{{{
#!python
     ...
     dict(blog_dict,template_name='Spam.html'),
     ...
}}}

in every URLconf. Maybe you could give it a tought.

"		closed	Generic views	dev		wontfix	Optional Arguments, Date-Based		Design decision needed	0	0	0	0	0	0
