为什么会出现此错误:form2 未定义 [英] Why do I get this error: form2 not defined

查看:39
本文介绍了为什么会出现此错误:form2 未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码:

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

在视图中:

{{=form2}}

我收到未定义 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.

推荐答案

你必须在花括号内使用 =form2,而不是括号.

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.

这篇关于为什么会出现此错误:form2 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆