[英]How can I fix this attribute error?
我正在使用web2py HTML视图,但仍会出错。 这是代码:
{{extend 'layout.html'}}
<h2>Edit your post</h2>
<h3>for category {{=form.record.category.name.title()}}</h3>
{{=form}}
和错误:
AttributeError: 'NoneType' object has no attribute 'name'
我该如何解决错误?
N / B控制器:
def edit_post():
id = post.id
form = SQLFORM(= A("Edit post",_href=URL(request.args=auth.user.id/login))
return locals()
请参阅有关如何创建表单的SQLFORM文档 。 我假设您在将代码发布到这里之前已经更改了代码,因为python由于SQLFORM
参数列表中的=
而不会编译它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.