...
> > * afterLoad() that is called just after the object has been created from
...
> > * beforeStore() that is called just before storing data in the DBMS
> 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?
>
It is basically what I was looking for, thanks. But (see my other
message), it may be nicer to do it at a class/type level much rather
than at attribute level. Assume, for example, that there are many
attributes of type Point and each needs to have its own _get and _set
method... Also, (if I understand it correctly), _ptX and _ptY are not
really encapsulated???
My favorite long term solution would still be user definable
types/classes for attributes where a single attribute may optionally
correspond to multiple fields in the table. (New example: address
that may break up in street, city, zip, country..).
cheers
--b
|