Re: [sqlalchemy] adapt MSVarchar to SLString

2010-04-16 Thread Chris Withers
Tony wrote: I was trying to copy a MS Sql server database to a Sqlite database (with SA 5.8), How? What code were you using? Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk -- You received this message because you are

[sqlalchemy] Re: KeyError when reflecting mssql tables that contains indexes with non alphanumeric chars in field names

2010-04-16 Thread ogg...@gmail.com
Ok. Submitted as ticket #1770 On 14 abr, 17:06, Michael Bayer mike...@zzzcomputing.com wrote: ogg...@gmail.com wrote: Hi, I'm just testing version 0.6 beta 3 with mssql and I've discovered that reflecting tables with indexes that contains fields with blank spaces raises a KeyError.

[sqlalchemy] Re: KeyError when reflecting mssql tables that contains indexes with non alphanumeric chars in field names

2010-04-16 Thread ogg...@gmail.com
Ok. Submitted as ticket #1770 On 14 abr, 17:06, Michael Bayer mike...@zzzcomputing.com wrote: ogg...@gmail.com wrote: Hi, I'm just testing version 0.6 beta 3 with mssql and I've discovered that reflecting tables with indexes that contains fields with blank spaces raises a KeyError.

Re: [sqlalchemy] cls._state / cls._state.get('original') class 'sqlalchemy.orm.attributes.CommittedState'

2010-04-16 Thread jose soares
jo wrote: Hi all, I cannot find anymore the attribute _state : if (not cls._state or not cls._state.get('original') or (cls._state['original'].data.get(k) != data.get(k: Could someone please help me? thank you j To explain better my problem, in version 0.3 my models have the

RE: [sqlalchemy] cls._state / cls._state.get('original') class 'sqlalchemy.orm.attributes.CommittedState'

2010-04-16 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of jose soares Sent: 16 April 2010 11:03 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] cls._state / cls._state.get('original') class

Re: [sqlalchemy] cls._state / cls._state.get('original') class 'sqlalchemy.orm.attributes.CommittedState'

2010-04-16 Thread jose soares
King Simon-NFHD78 wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of jose soares Sent: 16 April 2010 11:03 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] cls._state / cls._state.get('original') class

Re: [sqlalchemy] column_prefix

2010-04-16 Thread jose soares
I am sorry Michael, Maybe the problem is not in the column_prefix, The thing that I don't understand in this query is why sa tries to change the primary key of this row. I changed in my form only the value of id_operator, thus I expected a query like: UPDATE anagrafica SET id_operatore=1695

[sqlalchemy] Re: adapt MSVarchar to SLString

2010-04-16 Thread Tony
here is the code: engine_src= create_engine('mssql://blah_blah_blah) engine_dst= create_engine('sqlite:///new.sqlite') metadata_src = MetaData(bind=engine_src,reflect=True) metadata_dst= MetaData(bind=engine_dst) for table in metadata_src.sorted_tables: dest_table =

[sqlalchemy] Re: adapt MSVarchar to SLString

2010-04-16 Thread Tony Tan
here is the code I am using to copy the database: engine_src = create_engine('mssql://blah_blah_blah) engine_dst = create_engine('sqlite:///new.sqlite') metadata_src = MetaData(bind=engine_src,reflect=True) metadata_dst = MetaData(bind=engine_dst) for table in metadata_src.sorted_tables:

[sqlalchemy] Show SQL that would be executed to create a table - but don't do it?

2010-04-16 Thread Kirk Strauser
Given a largish file with a lot of table definitions in it, and SQLAlchemy 0.5.7, how can I see what SQL would be generated to create one specific table on a PostgreSQL database without actually attempting to create the table? -- Kirk Strauser -- You received this message because you are

[sqlalchemy] Re: Show SQL that would be executed to create a table - but don't do it?

2010-04-16 Thread Gerry Reno
FAQ: http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring On Apr 16, 11:04 am, Kirk Strauser k...@strauser.com wrote: Given a largish file with a lot of table definitions in it, and SQLAlchemy 0.5.7, how can I see what SQL would be generated to create one

Re: [sqlalchemy] cls._state / cls._state.get('original') class 'sqlalchemy.orm.attributes.CommittedState'

2010-04-16 Thread jose soares
Yes, it works, :-) Thank you Simon, j King Simon-NFHD78 wrote: Jo wrote: Thank you for replay my question, Simon, but I can't find the 'original' state there. j Here's an example that shows the results of the get_history function: # import sqlalchemy as sa import

Re: [sqlalchemy] Concrete table inheritance without a master table

2010-04-16 Thread WDyk
Here's the issue, boiled down to one file. On import, the last statement fails, mapping the Connections object. I just need to map two relations on an association object (Connections) to a polymorphic union (NetworkNode). Is there a way to do this? sqlalchemy.exc.ArgumentError: Column

Re: [sqlalchemy] Concrete table inheritance without a master table

2010-04-16 Thread Michael Bayer
w...@nobleenergyinc.com wrote: Here's the issue, boiled down to one file. On import, the last statement fails, mapping the Connections object. I just need to map two relations on an association object (Connections) to a polymorphic union (NetworkNode). Is there a way to do this? your

Re: [sqlalchemy] Concrete table inheritance without a master table

2010-04-16 Thread Michael Bayer
Michael Bayer wrote: w...@nobleenergyinc.com wrote: Here's the issue, boiled down to one file. On import, the last statement fails, mapping the Connections object. I just need to map two relations on an association object (Connections) to a polymorphic union (NetworkNode). Is there a way

[sqlalchemy] session.merge(obj, load=False) yields Parent instance obj at 0x18817d0 is not bound to a Session; lazy load operation of attribute 'predecessor' cannot proceed

2010-04-16 Thread Paul Balomiri
Hi, I was just trying to load a relation ( obj.predecessor) for obj. obj was created in a session, which has been committed, and closed afterwards. I merged obj to the session using session.merge(obj, load=False) but doing so yields this exception: Parent instance obj at 0x18817d0 is not

Re: [sqlalchemy] Concrete table inheritance without a master table

2010-04-16 Thread WDyk
-sqlalch...@googlegroups.com wrote: - To: sqlalchemy@googlegroups.com From: Michael Bayer mike...@zzzcomputing.com Sent by: sqlalchemy@googlegroups.com Date: 04/16/2010 02:57PM Subject: Re: [sqlalchemy] Concrete table inheritance without a master table w...@nobleenergyinc.com wrote:

[sqlalchemy] Re: session.merge(obj, load=False) yields Parent instance obj at 0x18817d0 is not bound to a Session; lazy load operation of attribute 'predecessor' cannot proceed

2010-04-16 Thread Paul Balomiri
My Fault, session.merge(obj, load=False) should be obj=session.merge(obj, load=False) 2010/4/17 Paul Balomiri paulbalom...@gmail.com: Hi, I was just trying to load a relation ( obj.predecessor) for obj. obj was created in a session, which has been committed, and closed afterwards. I