This approach is more flexible. It's easier to override template than
override view. You can still put your "context variable" logic there,
if you want.

Take Django admin as example. You can customize it quiet easily when
you override/subclass templates. If you want to customize view, you
have to sublass ModelAdmin or whole AdminSite. It's overkill when you
need tune some details like this.

Cheers,
 Tom


Dne Mon, 11 Mar 2013 11:51:47 +0000
Tom Evans <tevans...@googlemail.com> napsal(a):

> On Sat, Mar 9, 2013 at 10:28 AM, Tomas Ehrlich <tomas.ehrl...@gmail.com> 
> wrote:
> > Hi Nenad,
> > you can wrap your meta-refresh line in another block and then delete
> > it's content in templates which shouldn't be refreshed.
> >
> > # base_site.html
> > {% block extrahead %}
> >     {% block extrahead-refresh %}
> >         <meta http-equiv="refresh" content="60" />
> >     {% endblock %}
> > {% endblock %}
> >
> > # change_form.html -- deletes content of block extrahead-refresh
> > {% block extrahead-refresh %}{% endblock %}
> 
> 
> This approach is exactly what the docs are warning about. This is
> putting all of the logic of whether to display something into the
> template, and not the view.
> 
> Cheers
> 
> Tom
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to