Re: [sqlalchemy] how add comment before query statement?

2011-12-16 Thread bogun . dmitriy
2011/12/12 Michael Bayer mike...@zzzcomputing.com we have select.prefix_with() which can stick it right after the SELECT, if that worksotherwise if it really has to be the first thing would need to work in some @compiles tricks. then as far as Query I thought we had added something

Re: [sqlalchemy] MySQL significant order in set list of update command

2011-12-11 Thread bogun . dmitriy
2011/12/11 Michael Bayer mike...@zzzcomputing.com My impression was Postgresql handles this much more nicely which is confirmed by this post: http://beerpla.net/2009/02/17/swapping-column-values-in-mysql/ the usual way this kind of thing is done is via declaring local variables in the SQL

[sqlalchemy] MySQL significant order in set list of update command

2011-12-10 Thread bogun . dmitriy
Hi, All. I have found unexpected behaviour of MySQL DB. In update command order of operations in set list is significant. I need to switch values of 2 rows. Better see example: mysql create temporary table sw_test (a integer not null, b integer not null, dummy integer); Query OK, 0 rows affected

[sqlalchemy] looks like bug ses.query(data).update()

2010-09-30 Thread bogun . dmitriy
I try to update counter for omr object ang got following: Traceback (most recent call last): File /home/vugluskr/tmp/z/sa.py, line 56, in module main() File /home/vugluskr/tmp/z/sa.py, line 52, in main q2.update({data.cnt: data.cnt + 1}) File

Re: [sqlalchemy] looks like bug ses.query(data).update()

2010-09-30 Thread bogun . dmitriy
2010/9/30 Michael Bayer mike...@zzzcomputing.com: this is a bug , created at http://www.sqlalchemy.org/trac/ticket/1935 , and a patch which fixes this issue is there.     will try to get this committed soon. Thanks, patch fix issue. I try to update counter for omr object ang got following:

[sqlalchemy] is attribute changes?

2010-06-11 Thread bogun . dmitriy
Hello. Is sqlachemy allow to check for changes on particallar mapped attribute? Receive it's old value? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this

Re: [sqlalchemy] Some weir(for me) behavior of one-to-one relation.

2010-06-10 Thread bogun . dmitriy
I have 2 tables with one-to-one relation, and I got some unexpected behaviour from sqlalchemy. In attach there is demonstration script and its log. If I try to add object into table right for already existing key I expect error on DB level, telling about violation of unique constraint, but

[sqlalchemy] Some weir(for me) behavior of one-to-one relation.

2010-06-09 Thread bogun . dmitriy
Hello. I have 2 tables with one-to-one relation, and I got some unexpected behaviour from sqlalchemy. In attach there is demonstration script and its log. If I try to add object into table right for already existing key I expect error on DB level, telling about violation of unique constraint,

[sqlalchemy] Joined Table Inheritance

2010-05-20 Thread bogun . dmitriy
Hello. Is there any way I can use some expression for polymorphic_on mapper attribute? I have tried some ways, but not got what I want. # --- my tries import sqlalchemy as sa from sqlalchemy import * from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base _decl =

[sqlalchemy] Re: Joined Table Inheritance

2010-05-20 Thread bogun . dmitriy
Or maybe there is way to extend _polymorphic_map on application side? I am already have type field into DB, but I don't need separate class for earch possible type value. For such values I want use generic class. Without this, I must add one more type field. -- You received this message