Re: "Eval" in templates?

2008-07-06 Thread Ben Kovitz
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

Re: "Eval" in templates?

2008-07-05 Thread Ben Kovitz
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

"Eval" in templates?

2008-07-04 Thread Ben Kovitz
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 --~--~-