Please see the SQLFORM documentation about how you create the form. I assume you've changed the code before you posted it up here, since python wouldn't compile it because of the =
in the parameter list of SQLFORM
.
How can I fix this attribute error?
-
14-07-2023 - |
题
Am working on a web2py HTML view but keep getting an erros. This is the code:
{{extend 'layout.html'}}
<h2>Edit your post</h2>
<h3>for category {{=form.record.category.name.title()}}</h3>
{{=form}}
and the error:
AttributeError: 'NoneType' object has no attribute 'name'
How can i fix the error?
N/B controller:
def edit_post():
id = post.id
form = SQLFORM(= A("Edit post",_href=URL(request.args=auth.user.id/login))
return locals()
解决方案
不隶属于 StackOverflow