[sqlalchemy] SA cascade conflicts with MySQL ON DELETE

2009-10-20 Thread Max Ischenko
I have three related tables in MySQL and a corresponding mappings in SQLAlchemy. It all works fine until I tried to delete objects. I tinkered with different options but couldn't get it to work. Here is the relevant mappings: mapper(PlanetEntry, community_planet_tbl, properties={

[sqlalchemy] Some problems with foreignkeys...

2009-10-20 Thread Simone Z.
I have this code: from sqlalchemy import * metadata = MetaData() storia = Table('storia', metadata, Column(u'id', Integer, primary_key=True), Column(u'autore_id', Integer), Column(u'titolo', String), schema='public' ) storia_capitoli =

[sqlalchemy] Re: SA cascade conflicts with MySQL ON DELETE

2009-10-20 Thread Conor
Max Ischenko wrote: I have three related tables in MySQL and a corresponding mappings in SQLAlchemy. It all works fine until I tried to delete objects. I tinkered with different options but couldn't get it to work. Here is the relevant mappings: mapper(PlanetEntry,

[sqlalchemy] Re: Some problems with foreignkeys...

2009-10-20 Thread Simone Z.
On 20 Ott, 13:50, Simone Z. simone.zacca...@gmail.com wrote: Is there someone that could tell me why that happens? :) Deleting the schema parameter, it works again. But don't ask me why... :) Thanks and sorry for the noise, Simone --~--~-~--~~~---~--~~ You

[sqlalchemy] sqlalchemy and informixdb

2009-10-20 Thread goschtl
Hello SQLAlchemy, i am new to sqlalchemy, i currently work on project which needs sqlalchemy/informix integration. Maybe someone can have a look on this: session = Session() session sqlalchemy.orm.session.Session object at ... from sqlalchemy import MetaData metadata =

[sqlalchemy] Re: sqlalchemy and informixdb

2009-10-20 Thread Michael Bayer
goschtl wrote: Hello SQLAlchemy, i am new to sqlalchemy, i currently work on project which needs sqlalchemy/informix integration. Maybe someone can have a look on this: session = Session() session sqlalchemy.orm.session.Session object at ... from sqlalchemy import

[sqlalchemy] Re: sqlalchemy and informixdb

2009-10-20 Thread goschtl
On 20 Okt., 17:11, Michael Bayer mike...@zzzcomputing.com wrote: goschtl wrote: Hello SQLAlchemy, i am new to sqlalchemy, i currently work on project which needs sqlalchemy/informix integration. Maybe someone can have a look on this:     session = Session()     session    

[sqlalchemy] Re: sqlalchemy and informixdb

2009-10-20 Thread askel
Looks like I'm experiencing similar problems with InformixDB 2.5 and SQLAlchemy 0.5.6. Whenever parameters are sent for execution it looks like integers are used instead of placeholders like ? or :1. Flollowing are some examples: 2009-10-20 11:12:46,235 INFO

[sqlalchemy] Re: sqlalchemy and informixdb

2009-10-20 Thread Michael Bayer
askel wrote: Looks like I'm experiencing similar problems with InformixDB 2.5 and SQLAlchemy 0.5.6. Whenever parameters are sent for execution it looks like integers are used instead of placeholders like ? or :1. ah. Hopefully your DBAPi can support qmark parameters - pass

[sqlalchemy] Re: sqlalchemy and informixdb

2009-10-20 Thread Michael Bayer
askel wrote: Hi Mike, create_engine(..., paramstyle='qmark') has fixed the problem. Is there any DBAPI that treats numbers without leading semicolon as placeholders? How ebedded integers work then? Thank you for quick response and working solution. the integer thing you saw is a bug.

[sqlalchemy] Re: sqlalchemy and informixdb

2009-10-20 Thread askel
Michael, I'm sorry for calling you Mike. There is admin Mike that was giving me hard time all this morning and I have been writing to him alot recently. Cheers Alexander On Oct 20, 12:18 pm, askel dummy...@mail.ru wrote: Hi Mike, create_engine(..., paramstyle='qmark') has fixed the

[sqlalchemy] Re: purpose of class_mapper

2009-10-20 Thread Josh Stratton
What is the purpose of class_mapper?  I can't find it in the .4 docs for the tutorials I'm looking at, yet when I don't call it as https://svn.enthought.com/svn/enthought/sandbox/EnvisageSQLAlchemy/enthought/sqlalchemy/has_traits_orm.py notes, I get a AttributeError:             #

[sqlalchemy] Re: purpose of class_mapper

2009-10-20 Thread Michael Bayer
Josh Stratton wrote: AttributeError: 'MyObject' object has no attribute '_state' I don't see any _state printed out. The only additional attribute I see is the 'c' variable, where pull tables from. What is causing this _state thing to appear? Do I need to call class_mapper after each

[sqlalchemy] Re: Modifying the scopefunc of an existing ScopedSession

2009-10-20 Thread Michael Bayer
Gaetan de Menten wrote: Since I was curious about the reason this didn't work, I looked more closely at that part of the code and I don't like that __new__ trick: it doesn't really help simplify the code and can be surprising. Attached patch suppress it. thank you, this is committed in

[sqlalchemy] Re: purpose of class_mapper

2009-10-20 Thread Josh Stratton
AttributeError: 'MyObject' object has no attribute '_state' I don't see any _state printed out.  The only additional attribute I see is the 'c' variable, where pull tables from.  What is causing this _state thing to appear?  Do I need to call class_mapper after each mapper only only once

[sqlalchemy] Re: purpose of class_mapper

2009-10-20 Thread Josh Stratton
AttributeError: 'MyObject' object has no attribute '_state' I don't see any _state printed out.  The only additional attribute I see is the 'c' variable, where pull tables from.  What is causing this _state thing to appear?  Do I need to call class_mapper after each mapper only only once