Opened 18 years ago

Last modified 18 years ago

#3667 closed

Useful optional argument for generic views — at Initial Version

Reported by: sasch.pe@… Owned by: Jacob
Component: Generic views Version: dev
Severity: Keywords: Optional Arguments, Date-Based
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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:

info_dict = {

'queryset' : Spam.objects.all(),
'date_field' : 'pub_date',

}

i would like to have that:

info_dict = {

'queryset' : Spam.objects.all(),
'date_field' : 'pub_date',
'template_base' : 'templates',

}

This would simplyfy my URLconfs, currently if have to do a

...
dict(blog_dict,template_name='Spam.html'),
...

in every URLconf. Maybe you could give it a tought.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top