On Sat, 2003-04-12 at 02:54, Bud P.Bruegger wrote:
> Ian,
>
> I thought more about my "higher-level" types and believe what I really
> need are two hooks:
>
> * afterLoad() that is called just after the object has been created from
> data from the DBMS
>
> * beforeStore() that is called just before storing data in the DBMS
>
> By default, these don't do anything and need to be overloaded if one
> wants to use them.
>
> The following example shows how to apply this to my problem:
>
> assume _columns contains
> ...
> FloatCol('_ptX'),
> FloatCol('_ptY'),
> ...
I think you would want to do:
def _get_point(self):
return Point(self._ptX, self._ptY)
def _set_point(self, value):
self._ptX, self._ptY = value.x(), value.y()
Isn't that sufficient?
Ian
|