gpt4 book ai didi

google-app-engine - Appengine - 从 db.Model 转换为 ndb.Model?

转载 作者:行者123 更新时间:2023-12-04 05:35:47 26 4
gpt4 key购买 nike

我有一堆定义为 db.Model 的数据,我想将其转换为 ndb.Model。

我尝试从 db 更改为 ndb ,如下所示:

class Temp(db.Model):
temperature = db.FloatProperty()

class Temp(ndb.Model):
temperature = ndb.FloatProperty()

问题是我可以使用 temp 的 ndb 定义查询旧值(db 值)。但是当我已经有具有相同模型名称的 db-values 时,我似乎无法存储 ndb 值。

最佳答案

您是否收到任何特定错误?

在这个 thread 中解释说

You could even have two versions of the app, one using db and one using ndb, reading and writing the same entities in the datastore.



也看看这个 cheat sheet (也在线程中引用)将一个 db 应用程序转换为一个 ndb 应用程序。

关于google-app-engine - Appengine - 从 db.Model 转换为 ndb.Model?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11958055/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com