문제

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()
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top