From: Oleg B. <ph...@ph...> - 2008-07-01 18:53:14
|
On Tue, Jul 01, 2008 at 12:52:31PM -0500, Christopher Singley wrote: > class Example(sqlobject.SQLObject): > value = sqlobject.DecimalCol(size=10, precision=precision, > validator=PreciseDecimalValidator(precision=precision)) > > But this is very inelegant. Is there a way to use introspection instead? I do not consider this as inelegant. But we can decide to add an additional parameter: class Example(sqlobject.SQLObject): value = sqlobject.DecimalCol(size=10, precision=precision, quantize=precision) DecimalCol will pass the 'quantize' parameter down to the validator. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |