Look at db.DateTimeProperty, specifically its definition of
get_value_for_datastore.

get_value_for_datastore has access to model_instance so it can look at
other properties.

You should think about how your property knows the name of the other
property that it looks at.

On Feb 9, 2:45 pm, Jason DeFontes <ja...@defontes.com> wrote:
> Is there a simple way to have a calculated property that automatically
> updates itself any time an entity is saved? For example:
>
> class Article(db.Model):
>   body = db.StringProperty()
>   word_count = db.IntegerProperty()
>
> I'd like to put some code in the Article class such that word_count is
> automatically updated any time body is modified.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to