advantage that the
> common "{% include " in each of your button choices is factored out and
> appears only once, in blah.html.
>
> --Ned.http://nedbatchelder.com
>
> Ben Kovitz wrote:
> > Thanks for the encouragement, Alex. This was so easy, it sho
Thanks for the encouragement, Alex. This was so easy, it should be a
first lesson in how to write a custom tag. It took about 15 minutes
and worked the first time!
from django import template
register = template.Library()
@register.tag(name="eval")
def do_eval(parser, token):
try:
t
ne that decides
which button to render); or use {% if %} tags in blah.html (kind of
ugly, involves difficulties with parameter-passing, and we need to do
this all over the place, though we could stuff the {% if %} logic into
an included template).
Ben Kovitz
http://decisionero.com
--~--~-
3 matches
Mail list logo