保存ndb LocalStructured实体时,App Engine BadValueError

用户名

我有模特

class Foo(ndb.Model):
  x = ndb.IntegerProperty()

class Bar(ndb.Model):
  foo = ndb.StructuredProperty(Foo, repeated=True)

我最近一直在尝试保存Bar实体时,仅在生产中出现此错误:

BadValueError: Expected Foo instance, got Foo(x=100)

我记得不久前看到此错误,然后消失了。这是什么原因?

用户名

问题是我在保存模型的文件中为models.py使用了相对导入,因此python某种程度上认为Foo与Foo不同,因为它们在不同的包中。我将模型导入更改为绝对导入,现在可以正常工作了。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在继续其余代码之前,如何确保已保存App Engine NDB根实体

来自分类Dev

Google App Engine NDB查询

来自分类Dev

App Engine NDB交易冲突

来自分类Dev

使用WTForms中的数据填充App Engine NDB实体

来自分类Dev

模型验证器Google App引擎-BadValueError

来自分类Dev

以html格式输入Integer时引发BadValueError

来自分类Dev

以html格式输入Integer时引发BadValueError

来自分类Dev

此App Engine Ndb语法如何工作?

来自分类Dev

与Java的@NotPersistent等效的App Engine Python NDB

来自分类Dev

从Google App Engine NDB获取图像

来自分类Dev

App Engine NDB简单创建读取更新

来自分类Dev

Google App Engine NDB中的层次结构

来自分类Dev

从App Engine的NDB发布密钥是否安全?

来自分类Dev

Google App Engine-NDB-索引问题

来自分类Dev

Google App Engine NDB检索浮动属性

来自分类Dev

如何从Google App Engine NDB更新查询?

来自分类Dev

Google App Engine关于NDB中的密钥

来自分类Dev

使用Google App Engine NDB的Odoo | 从Postgresql移植到NDB

来自分类Dev

从google-app-engine ndb中删除日期时间早于N秒的实体

来自分类Dev

如何在python的Google App Engine中删除NDB模型的所有实体?

来自分类Dev

Google App Engine NDB数据存储区get_by_id以获取实体

来自分类Dev

如何在python的Google App Engine中删除NDB模型的所有实体?

来自分类Dev

从google-app-engine ndb中删除日期时间早于N秒的实体

来自分类Dev

使用Google App Engine的NDB作为消息队列?

来自分类Dev

Google App Engine NDB数据存储区的简单说明

来自分类Dev

App Engine NDB评论模型有哪些好的示例?

来自分类Dev

google app engine - ndb query to only get a few columns in python

来自分类Dev

Google App Engine ndb.delete_multi()的效率如何?

来自分类Dev

使用App Engine云端点访问ndb数据存储

Related 相关文章

  1. 1

    在继续其余代码之前,如何确保已保存App Engine NDB根实体

  2. 2

    Google App Engine NDB查询

  3. 3

    App Engine NDB交易冲突

  4. 4

    使用WTForms中的数据填充App Engine NDB实体

  5. 5

    模型验证器Google App引擎-BadValueError

  6. 6

    以html格式输入Integer时引发BadValueError

  7. 7

    以html格式输入Integer时引发BadValueError

  8. 8

    此App Engine Ndb语法如何工作?

  9. 9

    与Java的@NotPersistent等效的App Engine Python NDB

  10. 10

    从Google App Engine NDB获取图像

  11. 11

    App Engine NDB简单创建读取更新

  12. 12

    Google App Engine NDB中的层次结构

  13. 13

    从App Engine的NDB发布密钥是否安全?

  14. 14

    Google App Engine-NDB-索引问题

  15. 15

    Google App Engine NDB检索浮动属性

  16. 16

    如何从Google App Engine NDB更新查询?

  17. 17

    Google App Engine关于NDB中的密钥

  18. 18

    使用Google App Engine NDB的Odoo | 从Postgresql移植到NDB

  19. 19

    从google-app-engine ndb中删除日期时间早于N秒的实体

  20. 20

    如何在python的Google App Engine中删除NDB模型的所有实体?

  21. 21

    Google App Engine NDB数据存储区get_by_id以获取实体

  22. 22

    如何在python的Google App Engine中删除NDB模型的所有实体?

  23. 23

    从google-app-engine ndb中删除日期时间早于N秒的实体

  24. 24

    使用Google App Engine的NDB作为消息队列?

  25. 25

    Google App Engine NDB数据存储区的简单说明

  26. 26

    App Engine NDB评论模型有哪些好的示例?

  27. 27

    google app engine - ndb query to only get a few columns in python

  28. 28

    Google App Engine ndb.delete_multi()的效率如何?

  29. 29

    使用App Engine云端点访问ndb数据存储

热门标签

归档