le 07.09.2007 20:26 jason kirtland a écrit: > 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 > > Ok, thanks. I've adapted my code to deal with both cases. > -j > > > >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---