Why do I get this error: form2 not defined

随声附和 提交于 2019-12-11 19:35:31

问题


My code:

def return_post:
    form = SQLFORM(db.post)
    for c in form:
    form1= post.body
    form2 = form1.split()
return dict(form2=form2)

In view:

{{=form2}}

I get the error that form2 is not defined. The above is the actual code. I had actually posted this from the Samsung tab and could not get the curly brackets.


回答1:


You have to use =form2 within curly braces, not parenthesis.

{{=form2}}

Change it and try again. If using your tablet, try copy-pasting the above line. That should work.



来源:https://stackoverflow.com/questions/23765545/why-do-i-get-this-error-form2-not-defined

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!