Re: [SQLObject] Saving a rol with a derivative atribute
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Oleg B. <ph...@ph...> - 2013-09-11 15:19:20
|
On Wed, Sep 11, 2013 at 06:29:57PM +0400, Oleg Broytman <ph...@ph...> wrote:
> If you only need to set the default once you can override method
> __init__ in your class, set the default and call parent's __init__. You
> can also override .set() but simple assignment like
>
> row.title = new_value
>
> doesn't call 'set(). If you want to catch all assignments events is the
> only route.
And, BTW, overriding ._create() would be simpler than __init__.
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|