From: Oleg B. <ph...@ph...> - 2008-02-08 19:03:46
|
On Fri, Feb 08, 2008 at 12:41:54PM -0600, Christopher Singley wrote: > I guess the mapping Decimal <-> str ought to be pretty easy, since it's > supported by Python's decimal module. I don't remember Decimal can do conversion to string and back from string preserving precision. Are you talking about converting to floating-point string? str(Decimal("1.1")) => '1.1'? I don't know if the conversion preserves all digits. But if it does - that's the way to go, of course. > Are we talking about modifying sqlobject.sqlite.sqliteconnection.__init__() to > define adapter/converter function and register them with pysqlite? Yes. > Wouldn't > that just be about 4 lines of code? Plus tests, plus at least a line in News.txt, plus thinking if it breaks something for those who now use floats with DecimalCol. > You'll have to pardon me. I don't mind doing work, but looking at the > SQLObject source code makes my head spin a little bit. Is it really that bad? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |