Can I use ComputedProperty?

I need computed property support in App Engine. I downloaded the latest version of the source code to try and implement them myself. After going through the code, I came across a class of properties that already seems to be doing 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 is that it is not documented; I can not find anything about ComputedProperty in ComputedProperty papers.

So, is ComputedProperty safe to use or does it not work and / or can be changed?

+4
source share
2 answers

ComputedProperty seems to be a β€œport” (due to the lack of a better word) of a custom property class called DerivedProperty from Nick Johnson's blog .

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

+7
source

Since then they have been run and documented, at least for the NDB API:

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

+3
source

All Articles