开发者

Twistar ORM refresh function

开发者 https://www.devze.com 2023-04-13 06:29 出处:网络
Maybe I did not understand, but I can not update the object. The procedure is as follows: I do SELECT (find()), get the object.

Maybe I did not understand, but I can not update the object. The procedure is as follows:

  1. I do SELECT (find()), get the object.
  2. Change some properties in the properties of this object
  3. Run the refresh.

Then I get the following error:

exceptions.AttributeError: 'list' object has no attribute 'keys'

Even when I try to call the refresh on object without changing its proper开发者_高级运维ties, I get the same error.


Without code, it's not likely anyone will provide a useful answer. The obvious response is that you're looking up the keys attribute on a list, and lists do not have that attribute. You should have learned that much by reading the exception, though. The traceback will tell you where the exception occurred (and the call stack at the time). You can use that to find the broken code, and learn the context in which it is broken. The "procedure" you describe doesn't really matter for bugs at this level - you're simply using an object incorrectly (probably treating a list as though it were a dict) and need to fix that.

0

精彩评论

暂无评论...
验证码 换一张
取 消