Actually, I've thought more about the issue below. The problem aren't
properties, the problem are when you define them: either at class
creation time (via __metaclass__ and inheritance from SQLObject) or at
runtime after the class is created:
In the former case, you define property setters and getters before the
user can and the user has to take you setters and getters into
consideration--in the latter case, you have to take possible setters
and getters defined by the user into consideration. This should be
possible through introspection...???
--b
On Thu, 22 May 2003 23:10:33 +0200
"Bud P. Bruegger" <bu...@si...> wrote:
> > Oh, and I'm not sure what we're talking about as far as properties go. When
> > I said 'manually defining properties will be ignored' i meant SQLObject
> > doesn't care about them, and they'll work fine.
>
> Not sure whether I misunderstand, so to find out here is how I think
> about the issue. Every column corrsponds to a property whose setter
> method is overloaded to store the object in the dbms. If application
> programmers have a reason to (independently of SQLObject) make the
> same attribute into a property, they have to possibly call SQLObject's
> setter method from their setter method (in the same way as the
> __init__ of a subclass usually calls the __init__ of the superclass).
> One possible example of such as thing would be to log all state
> changes to a file.
>
> So if this understanding of what is happening is accurate, application
> programmer need to take special steps when defining properties related
> to columns. Or to avoid that, use the non-standard-python shortcut
> method to define properties. So in any case, the way to define
> properties (related to columns) is different from that of plain pyton.
> In contrast, if column values are simply represented in the __dict__
> of the instance, everything is as in plain python.
/-----------------------------------------------------------------
| Bud P. Bruegger, Ph.D.
| Sistema (www.sistema.it)
| Via U. Bassi, 54
| 58100 Grosseto, Italy
| +39-0564-411682 (voice and fax)
\-----------------------------------------------------------------
|