python - 使用 ComputedProperty 安全吗?

标签 python google-app-engine

我需要在 App Engine 中支持计算属性。我下载了最新的源代码版本来尝试自己实现它们。在检查代码时,我遇到了一个似乎已经完全我需要的属性类。

class ComputedProperty(Property):
  """Property used for creating properties derived from other values.

  Certain attributes should never be set by users but automatically
  calculated at run-time from other values of the same entity.  These
  values are implemented as persistent properties because they provide
  useful search keys.

  ...
  """

未记录的问题;我在官方文档中找不到有关 ComputedProperty 的任何信息。

ComputedProperty 是否可以安全使用,或者它是否存在错误或/并且可能会发生变化?

最佳答案

ComputedProperty 似乎是名为 DerivedProperty from Nick Johnson's blog 的自定义属性类的“端口”(缺少更好的词) .

由于 Nick 的博客条目显示了创建自定义数据存储 Property 类是多么容易,所以我不会太担心 ComputedProperty,因为您可以随时替换它如果需要,使用您自己的 Property 子类。

关于python - 使用 ComputedProperty 安全吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3541398/

相关文章:

google-app-engine - Gmail REST API 线程搜索未给出预期结果

java - HttpClient 抛出 ssl 错误,但 webview 和 HttpsURLConnection 不会

python - 了解 "runwithfriends"facebook-app 示例代码

python - 二进制文档分类

python - 使用 AutoSklearn 时得到 "UserWarning: Port 8787 is already in use",为什么 AutoSklearn 会使用端口?

python - 让 Python 等待函数完成后再继续执行程序

java - 使用 Java 登录我的 Sprint 手机网络帐户并获取帐户详细信息的最佳方式?

java - 测量 Google App Engine 中的任务队列成本

python - 如何打印csv文件中的列数和行数?

python - 在 GridSearchCV 中使用多指标评估