0
我在一个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()
你的'form.record.category'返回'None'试图找出原因。 – sshashank124
你的代码中还有一个额外的''''。 – sshashank124