Re: [sqlalchemy] Wrong parameter order for querying mapper class having column_property with limit

2014-05-01 Thread Çağatay Tengiz
Wow this was very fast! Thanks for your support. Best regards. Cagatay 1 Mayıs 2014 Perşembe 02:08:47 UTC+3 tarihinde Michael Bayer yazdı: this is issue: https://bitbucket.org/zzzeek/sqlalchemy/issue/3038/compilers-that-apply-binds-in-select and resolved in master / rel_0_9 in

Re: [sqlalchemy] SQLAlchemy: mixing SQL Expression and ORM: something unexpected

2014-05-01 Thread Michael Bayer
ok when you run a statement like this: upd = update(X).execute() you're using something called implicit execution. I'd be curious to know how you came to be using this style, as the docs have all but hidden it away - if some tutorial somewhere is using it, that tutorial is badly out of

Re: [sqlalchemy] Reuse pre-defined Enum?

2014-05-01 Thread Vlad Wing
use the PG ENUM type instead and add create_type=False: from sqlalchemy.dialects.postgresql import ENUM ENUM(‘male’, ‘female’, name=‘gt’, create_type=False) This method didn't work for me. The safest way I could find is to manually edit the autogenerated script, removing the reference

Re: [sqlalchemy] Reuse pre-defined Enum?

2014-05-01 Thread Michael Bayer
On May 1, 2014, at 1:09 PM, Vlad Wing vlad.w...@gmail.com wrote: use the PG ENUM type instead and add create_type=False: from sqlalchemy.dialects.postgresql import ENUM ENUM('male', 'female', name='gt', create_type=False) This method didn't work for me. The safest way I could find

Re: [sqlalchemy] Reuse pre-defined Enum?

2014-05-01 Thread Vlad Wing
Yes, that's exactly what happend. I specified create_type=False and it was ignored. Alembic tried to create the type anyway and, of course, it failed. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop

Re: [sqlalchemy] Reuse pre-defined Enum?

2014-05-01 Thread Michael Bayer
OK. ENUM is something I'd have to dedicate several days of attention on :( On May 1, 2014, at 1:32 PM, Vlad Wing vlad.w...@gmail.com wrote: Yes, that's exactly what happend. I specified create_type=False and it was ignored. Alembic tried to create the type anyway and, of course, it failed.

[sqlalchemy] What is the idiomatic Way to implement ON DUPLICATE KEY UPDATE in SQLAlchemy using session with bind

2014-05-01 Thread Jinu p.r
Hi All, I http://stackoverflow.com/questions/17538048/efficient-update-insert-on-fail-with-sqlalchemy# essentially need to do an INSERT ... ON DUPLICATE KEY UPDATE on an existing table with composite primary key using session with bind. What is the idiomatic way to implement

Re: [sqlalchemy] What is the idiomatic Way to implement ON DUPLICATE KEY UPDATE in SQLAlchemy using session with bind

2014-05-01 Thread Michael Bayer
this is MySQL specific and is not represented by a SQLAlchemy structure right now (which would be a MERGE construct that somehow doubles as a MySQL placeholder) so just use a string: session.execute(INSERT ... ON DUPLICATE KEY UPDATE...) On May 1, 2014, at 2:01 PM, Jinu p.r jinu@gmail.com