python - NameError: name 'form' is not defined -
i trying return custom form controller method given below:
searchform=sqlform.factory( field('uid', requires=is_not_empty()), field('uaccount', requires=is_not_empty())) if searchform.accepts(request,session): response.flash = 'form accepted' elif searchform.errors: response.flash = 'form has errors' else: response.flash = 'please fill form' return dict(form=searchform)
in index.html, have written following code render form:
{{=form.custom.begin}} {{=form.custom.widget.uid}} {{=form.custom.widget.uaccount}} {{=form.custom.submit}} {{=form.custom.end}}
but error message : nameerror: name 'form' not defined
i have checked response using response._vars, contains form gluon.sqlhtml.sqlform object @ 0x07d5efb0
Comments
Post a Comment