views:

55

answers:

1

I need support for computed properties in App Engine. I downloaded the latest source release to try and implement them myself. Whilst going through code, I came across a property class that already seems to do exactly what I need.

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.

  ...
  """

The problem that it's undocumented; I can't find anything about ComputedProperty in the official docs.

So is ComputedProperty safe to use or is it buggy or/and subject to change?

+5  A: 

ComputedProperty seems to be a "port" (for lack of a better word) of a custom property class named DerivedProperty from Nick Johnson's blog.

Since Nick's blog entry shows how easy it can be to create a custom datastore Property class, I wouldn't worry much about ComputedProperty, as you can always replace it with a Property subclass of your own if need be.

matt b