On Sat, Apr 23, 2011 at 08:06:50PM -0600, Pгoм???тн?????s 0x01 wrote:
> Another newbie question: is it possible to override the *.by<AltID> method?
It's hard 'cause .by* methods are created on the fly, not via
inheritance.
> I have a custom encoding for that column (it is in base64), and I can't call
> it naturally unless I can override the method. Writing my own method doesn't
> seem to work -- it doesn't get called at all!
In this case you should rather create a validator that will encode
and decode your data. Similar to what HashCol does - see the source in
sqlobject/include/hascol.py. Validators work for all methods.
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|