[sqlalchemy] mysql double issue

2013-11-20 Thread Sebastian Elsner
Hello, I am inserting float data into a MySQL column of type DOUBLE. The data gets inserted properly (verified via mysql terminal). Querying for the object returns a Decimal object, but the number of digits after the decimal point if always limited to 11 (while DOUBLE supports 15 by

[sqlalchemy] nullable/association question

2013-11-20 Thread lars van gemerden
Hi all, I have 2 sqla classes with mapped tables: User and Role with a many to many relationship (User.roles/Role.users) through an association table. User has columns email and password, both non nullable. I create an instance of User but do not commit it yet, next i do a query on Role:

[sqlalchemy] MemoryError in SA 0.8.3 on mssql

2013-11-20 Thread Ed Singleton
I'm getting a Memory error when trying to get data from my database. It happens during a process that loads fixture data into the database, but the error always happens at the same point on a line that fetches a single record from the db. Essentially the line does `item =

Re: [sqlalchemy] Invalid query formed: table listed twice in FROM

2013-11-20 Thread Michael Bayer
Oh, it’s the serializer, that makes sense. An example would help and this is likely to be some bug that can be fixed (since a Table of a particular name should not change its id(), it comes back from the same MetaData collection based on name), but overall I would strongly recommend not

Re: [sqlalchemy] mysql double issue

2013-11-20 Thread Michael Bayer
the short answer is that DOUBLE is doing a Decimal conversion here and that’s where the digits are being lost. So fix the problem immediately using asdecimal=False, then also make sure you use repr() to print out your type as str() for Python floats also truncates: class SomeClass(Base):

Re: [sqlalchemy] nullable/association question

2013-11-20 Thread Michael Bayer
you either want to prevent User from being cascaded and/or added into the Session ahead of time, which if this is occurring via backref you might want to look at casade_backrefs=False

Re: [sqlalchemy] mysql double issue

2013-11-20 Thread Sebastian Elsner
Amazing! Thank you! On 11/20/2013 04:44 PM, Michael Bayer wrote: the short answer is that DOUBLE is doing a Decimal conversion here and that’s where the digits are being lost. So fix the problem immediately using asdecimal=False, then also make sure you use repr() to print out your type as

Re: [sqlalchemy] MemoryError in SA 0.8.3 on mssql

2013-11-20 Thread Michael Bayer
On Nov 20, 2013, at 9:39 AM, Ed Singleton singleto...@gmail.com wrote: I'm getting a Memory error when trying to get data from my database. It happens during a process that loads fixture data into the database, but the error always happens at the same point on a line that fetches a single

Re: [sqlalchemy] MemoryError in SA 0.8.3 on mssql

2013-11-20 Thread Ed Singleton
On 20 Nov 2013, at 15:56, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 20, 2013, at 9:39 AM, Ed Singleton singleto...@gmail.com wrote: I'm getting a Memory error when trying to get data from my database. It happens during a process that loads fixture data into the database, but

Re: [sqlalchemy] MemoryError in SA 0.8.3 on mssql

2013-11-20 Thread Michael Bayer
On Nov 20, 2013, at 3:56 PM, Ed Singleton singleto...@gmail.com wrote: On 20 Nov 2013, at 15:56, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 20, 2013, at 9:39 AM, Ed Singleton singleto...@gmail.com wrote: I'm getting a Memory error when trying to get data from my database. It