From: Oleg B. <ph...@ph...> - 2008-02-13 11:12:18
|
On Tue, Feb 12, 2008 at 05:37:26PM -0600, Christopher Singley wrote: > foo = Test(number=Decimal('23')) > print type(foo.number) Good catch. Can you believe I am going to fix the entire problem with such small and simple patch as Index: col.py =================================================================== --- col.py (revision 3248) +++ col.py (working copy) @@ -1330,6 +1330,9 @@ return [DecimalValidator()] + \ super(SODecimalCol, self).createValidators() + def _sqliteType(self): + return "TEXT" + class DecimalCol(Col): baseClass = SODecimalCol ? The idea is to change type affinity in SQLite from NUMERIC (int/float) to TEXT to forbid SQLite to convert Decimal strings to floats. On the other hand that could bring problems with SQL manipulations such as ORDER BY... Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |