I have a controller/view like these:

def control():
    if some_condition():
        return dict(form=form)
    else:
        return dict(form=form, table=get_table())

{{extend 'layout.html'}}
{{=form}}
{{if table:}}{{=table}}{{pass}}

i.e. 'form' is always present in the view and 'table' sometimes. The
{{if table:}}{{=table}}{{pass}}
condition doesn't seem to be working because when some_condition()
returns true I get:

Traceback (most recent call last):
  File "/pub/web2py/gluon/restricted.py", line 194, in restricted
    exec ccode in environment
  File "/pub/web2py/applications/manage/views/default/control.html",
line 86, in <module>
NameError: name 'table' is not defined

I am missing something silly here. Actually believe this used to work.
Want to rule out view error before I look other places. Thanks for
your help!

Reply via email to