remi jolin wrote:
> le 07.09.2007 19:47 remi jolin a écrit:
>> le 07.09.2007 19:27 Michael Bayer a écrit:
>>
>>> numeric types are going to come out using decimal.Decimal objects in
>>> 0.4 but not exactly sure whats happening there...do a repr(m.price).
>>>
>>>
>>>
>> it gives Decimal("10.00")
>>
>> and I'm using SA 0.3.10
>> Is there a difference regarding Numeric between 0.3.7 and 0.3.10 because
>> the system where I have sqlite DB is using 0.3.7 ??
>>
> I've just tested with 0.3.10 and sqlite : repr(m.price) gives 10.0 so it
> is not a difference due the SA versions but only DB access implementation.
NUMERIC columns will return Decimals on some db-apis, but not sqlite. In
0.4, the sqlalchemy Numeric type adapts as needed to ensure Decimal
across all db-apis. But in 0.3, what the db-api returns is what you get
for numerics.
Comparing against Decimals will have the results you expect:
>>> m.price > Decimal('12.34')
False
-j
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---