Twistar ORM刷新功能

发布于 2024-12-09 19:09:11 字数 280 浏览 1 评论 0原文

也许我不明白,但我无法更新对象。过程如下:

  1. 我执行 SELECT (find()),获取对象。
  2. 更改此对象的属性中的某些属性
  3. 运行刷新。

然后我收到以下错误:

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

即使当我尝试在对象上调用刷新而不更改其属性时,我也会收到相同的错误。

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 properties, I get the same error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝眼泪 2024-12-16 19:09:11

如果没有代码,就不可能有人提供有用的答案。明显的响应是您正在 list 上查找 keys 属性,而列表没有该属性。不过,通过阅读异常,您应该已经学到了很多东西。回溯将告诉您异常发生的位置(以及当时的调用堆栈)。您可以使用它来查找损坏的代码,并了解其损坏的上下文。您描述的“过程”对于这个级别的错误并不重要 - 您只是错误地使用了一个对象(可能将列表视为字典)并且需要修复它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文