简体   繁体   English

如何解决此属性错误?

[英]How can I fix this attribute error?

Am working on a web2py HTML view but keep getting an erros. 我正在使用web2py HTML视图,但仍会出错。 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: N / B控制器:

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. 请参阅有关如何创建表单的SQLFORM文档 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 . 我假设您在将代码发布到这里之前已经更改了代码,因为python由于SQLFORM参数列表中的=而不会编译它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我会收到属性错误? 我该如何解决? - Why am I getting an attribute error? How can I fix it? 我如何用我的网络抓取新手代码修复这个属性错误? - How can I fix this attribute error with my novice webscraping code? 我收到类中定义的属性的属性错误。 我怎样才能解决这个问题? - I am getting an attribute error for an attribute defined inside the class. How can I fix this? 如何修复 python 中的属性错误? - How do I fix the attribute error in python? 如何修复此属性错误 python? - How do I fix this attribute error python? 如何解决此rstrip属性错误? - How do I fix this rstrip attribute error? 我收到模块 'cv2.cv2' has no attribute 'legacy' 错误。 我该如何解决? - I'm getting module 'cv2.cv2' has no attribute 'legacy' ERROR. How can I fix it? 错误消息-(AttributeError:蠕虫实例没有属性&#39;vx&#39;)是什么意思,我该如何解决? - What does error message -(AttributeError: Worm instance has no attribute 'vx') mean and how can i fix it? 如何解决此错误:AttributeError:&#39;list&#39;对象没有属性&#39;items&#39;? - How can I fix this error: AttributeError: 'list' object has no attribute 'items'? 如何修复以下错误AttributeError:&#39;dict&#39;对象没有属性&#39;text&#39; - How can I fix the following error AttributeError: 'dict' object has no attribute 'text'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM