代码之家  ›  专栏  ›  技术社区  ›  hwiechers

使用ComputedProperty安全吗?

  •  4
  • hwiechers  · 技术社区  · 14 年前

    我需要对应用程序引擎中的计算属性的支持。我下载了最新的源代码版本来尝试自己实现它们。在浏览代码时,我遇到了一个属性类,它似乎已经完成了 我需要什么。

    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 在官方文件中。

    我也是 安全使用,还是有小车或/或随时更换?

    2 回复  |  直到 14 年前
        1
  •  7
  •   matt b    14 年前

    ComputedProperty 似乎是一个名为 DerivedProperty from Nick Johnson's blog .

    Property 同学们,我不太担心 计算属性 ,因为你总是可以用 财产 你自己的子类,如果需要的话。

        2
  •  3
  •   John Mellor    11 年前

    此后,至少针对NDB API,已经发布并记录了以下内容:

    https://developers.google.com/appengine/docs/python/ndb/properties#computed