Changes between Initial Version and Version 2 of Ticket #3667


Ignore:
Timestamp:
Mar 9, 2007, 6:19:34 AM (18 years ago)
Author:
Malcolm Tredinnick
Comment:

This just seems to be a different way of achieving what can already be done using template_name. If you want slightly different syntax, you can wrap the generic view calls in your own function or class (with a __call__ method) and use that.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3667

    • Property Triage Stage UnreviewedDesign decision needed
    • Property Resolutionwontfix
    • Property Status newclosed
  • Ticket #3667 – Description

    initial v2  
    11Hello 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:
    22
     3{{{
     4#!python
    35info_dict = {
    46    'queryset' : Spam.objects.all(),
    57    'date_field' : 'pub_date',
    68}
     9}}}
    710
    811i would like to have that:
    912
     13{{{
     14#!python
    1015info_dict = {
    1116    'queryset' : Spam.objects.all(),
     
    1318    'template_base' : 'templates',
    1419}
    15 
     20}}}
    1621This would simplyfy my URLconfs, currently if have to do a
    1722
     23{{{
     24#!python
    1825     ...
    1926     dict(blog_dict,template_name='Spam.html'),
    2027     ...
     28}}}
    2129
    2230in every URLconf. Maybe you could give it a tought.
Back to Top