[google-appengine] Re: How to overwrite the default save method

2009-03-13 Thread Devel63
You may want to look at get_value_for_datastore here: http://code.google.com/appengine/articles/extending_models.html This gets called in the course of a put, and can be used to accomplish other actions as well. On Mar 13, 5:06 am, "Michael O'Brien" wrote: > If you want to add something to __in

[google-appengine] Re: How to overwrite the default save method

2009-03-13 Thread Michael O'Brien
If you want to add something to __init__, you can do something like this: class A(BaseModel): def __init__(self, *args, **kwargs): # do something here, e.g. adding values to kwargs (property values) kwargs["canonical_name"] = kwargs["name"].lower().strip() super(A, sel

[google-appengine] Re: How to overwrite the default save method

2009-03-13 Thread Jarek Zgoda
Be aware that in current version save() contains code literally copied from put() so you'd like to have in your model class the code like: def put(self): # do something before save key = super(MyModel, self).put() # do something after save return key save = put On 13 Mar, 05:45, yucc w