From: Ian B. <ia...@co...> - 2004-12-30 17:01:15
|
pkoelle wrote: > I am surely overlooking something simple but haven't found a way > override the setter and not hardcoding the columns name. > I can do something like: > > def _setName(self, value): > blabla > self._SO_set_Name(value) > > but this applies to the Name column only and I have to perform the > *same* operation for *all* columns and rather like to avoid writing the > same code for each column. Basically I'd like to update an ini file > through ConfigParser on writes, where the option (in terms of > ConfigParser) should be the name attribute of the column being changed. > I have no idea if messing with _SO_setValue() is a sane approach. > Moreover, there seems no way to get the name attribute of the column at > runtime... Any ideas? If you want something that gets triggered on every update, then overriding _SO_setValue() and set() would probably make sense. It's not a stable interface, in that it might get changed in the future (but not for a little while at least). -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |