Py学习  »  问与答

RelatedObjectDoesNotExist: Accident has no companyname. 谢谢啊

光盘的鸡丝-weibo • 9 年前 • 2598 次点击  

Accident.objects.all() [<Accident: hfhh>, <Accident: 1312>]

q=Accident(accidentname="hfhh") q.companyname Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/Django-1.8.8-py2.7.egg/django/db/models/fields/related.py", line 623, in get "%s has no %s." % (self.field.model.name, self.field.name) RelatedObjectDoesNotExist: Accident has no companyname.

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1421
 
2598 次点击