Re: [SQLObject] Overriding new()..._SO_new()?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-10-10 15:29:07
|
On Friday, October 10, 2003, at 10:12 AM, Brad Bollenbach wrote: > Hi, > > I would have thought it to be pretty common to want to customize what > happens when a new SQLObject is created. > > In my case, I have to use cases at the moment: > > 1. I want the default of a date column in my Transaction object to be > the time at which the object was created. > > 2. I want my other types of transactions (Purchase, Refund, > ChargeBack, ServiceCharge, etc, etc) to be smart enough to accept all > the arguments (in their new() method) of both their respective tables, > and the transaction table, so that each one is smart enough to > transparently add the necessary row to the transaction table. > > In both cases, I need to customize the behaviour of creating a new > SQLObject. > > Am I missing a way in which this can be done, or should SQLObject have > an _SO_new? You can override new() just like it is. (Though number 1 can probably be handled with a column default) -- Ian Bicking | ia...@co... | http://blog.ianbicking.org |