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/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to