If you decide to go the factory route, you could always make the
factory a class method.
http://docs.python.org/library/functions.html#classmethod
class YourModel(db.model):
@classmethod
def create_new(cls, **kwargs):
# check args... raise exception / return None on error
return cls(**kwargs)
new_model = YourModel.create_new(this='that', some='thing')
On Wed, Aug 24, 2011 at 19:37, Santiago Basulto
<[email protected]> wrote:
> Yes, i think that's the best way to do it.
>
> Thank you both.
>
> El día 24 de agosto de 2011 20:29, sebastián serrano
> <[email protected]> escribió:
>> Hi
>> I think this article from the app engine blog has a more clear description
>> of custom properties for this usage:
>> http://googleappengine.blogspot.com/2009/07/writing-custom-property-classes.html
>>
>> Cheers, Sebastian
>> www.devsar.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/google-appengine/-/KqHkF0NXxhgJ.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
>
>
> --
> Santiago Basulto.-
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.