[sqlalchemy] How to turn off UPDATE on child objects when deleting parent object

2008-09-30 Thread Randy Syring
More details are here: http://groups.google.com/group/sqlelixir/browse_thread/thread/aac5d22702e3a8ec But basically, I have a relationship between a parent (Item) table and child (Link) table. When I try to delete an Item, an SQL statement is generated by SQLAlchemy that tries to set

[sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object

2008-09-30 Thread Randy Syring
Sorry, one follow-up. I can actually get this to work by setting cascade='all, delete-orphan'. But since the FK will do a cascading delete, it is slower for SQLAlchemy to have to issue the statements. Can I just make SQLAlchemy not issue anything when deleting the parent? On Sep 30, 2:14 am,

[sqlalchemy] Re: mysql to sqlalchemy table definition in .py file?

2008-09-30 Thread az
well it's up to you to extend it to mysql... i don't use mysql, nor i know much about sql anyway; all specific stuff there is a steal/copy/try/error. http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/misc/metadata/autoload.py?revision=208view=markup give it dburl another thing i

[sqlalchemy] Re: Setting up a many-to-many relation with no right-hand-side table

2008-09-30 Thread Nick Murdoch
we have the wrapper thing, its the associationproxy.   docs are   here:  http://www.sqlalchemy.org/docs/04/plugins.html#plugins_associationproxy    . In this case you'd probably map a class to the user_articles_table and   use associationproxy to create user.articles against article id. Hi

[sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object

2008-09-30 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Randy Syring Sent: 30 September 2008 07:17 To: sqlalchemy Subject: [sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object On Sep 30, 2:14 am, Randy Syring

[sqlalchemy] Re: realize a join between two tables over a mediate table - SQLAlchemy-0.4.7

2008-09-30 Thread kai . krackler
Hello Michael, many thanks for answer. The tables are inputted automatically by SQLAlchemy. Because of this I thought there should not be confusion over schema names. Well, I could solve the problem by following code: ---

[sqlalchemy] Connecting SA to an iSeries DB2 with pyodbc

2008-09-30 Thread goschtl
Hi, i try to connect with SA to an iSeries DB2 Database. I use the pyodbc python module for this. This piece of code is working: - import pyodbc conn = pyodbc.connect('DSN=AS400') curs = conn.cursor() curs.execute('select

[sqlalchemy] Re: Setting up a many-to-many relation with no right-hand-side table

2008-09-30 Thread Michael Bayer
On Sep 30, 2008, at 4:59 AM, Nick Murdoch wrote: we have the wrapper thing, its the associationproxy. docs are here: http://www.sqlalchemy.org/docs/04/plugins.html#plugins_associationproxy . In this case you'd probably map a class to the user_articles_table and use

[sqlalchemy] Re: Connecting SA to an iSeries DB2 with pyodbc

2008-09-30 Thread Michael Bayer
have you tried: http://code.google.com/p/ibm-db/ the important part of the database connectivity is the dialect which determines the rendering of SQL. We don't have that built in for DB2, which is why I'd recommend IBM's dialect. On Sep 30, 2008, at 3:45 AM, goschtl wrote: Hi, i try

[sqlalchemy] Re: realize a join between two tables over a mediate table - SQLAlchemy-0.4.7

2008-09-30 Thread Michael Bayer
On Sep 30, 2008, at 5:16 AM, [EMAIL PROTECTED] wrote: Hello Michael, many thanks for answer. The tables are inputted automatically by SQLAlchemy. Because of this I thought there should not be confusion over schema names. you mean autoload=True. You might want to remove the

[sqlalchemy] Re: Setting up a many-to-many relation with no right-hand-side table

2008-09-30 Thread Nick Murdoch
On Sep 30, 3:06 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Sep 30, 2008, at 4:59 AM, Nick Murdoch wrote: we have the wrapper thing, its the associationproxy.   docs are here:   http://www.sqlalchemy.org/docs/04/plugins.html#plugins_associationproxy    . In this case you'd

[sqlalchemy] unions in query?

2008-09-30 Thread az
hi i'm back into my hierachy/graph of objects, which has many paths reaching from one end to another - A-Z, A-B-Z, A-B-C-Z etc. Using hierarchical OR (AND (OR ...))) works but gets very slow as all the 20+ tables involved go in same FROM clause. so i have these questions: - (theoretical) can

[sqlalchemy] getting all indexes in a metadata instance

2008-09-30 Thread Sean Davis
I am mirroring a database from mysql to postgresql. Mysql allows indexes to have the same names as columns. I would like to find all the indexes and rename them systematically to avoid these name collisions. How can I get the list of indexes and then modify the names before creating the second

[sqlalchemy] Re: getting all indexes in a metadata instance

2008-09-30 Thread Sean Davis
On Sep 30, 11:18 am, Sean Davis [EMAIL PROTECTED] wrote: I am mirroring a database from mysql to postgresql.  Mysql allows indexes to have the same names as columns.  I would like to find all the indexes and rename them systematically to avoid these name collisions.  How can I get the list

[sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object

2008-09-30 Thread Randy Syring
Simon, THANK YOU!! Yes, I believe that will do it. On Sep 30, 5:12 am, King Simon-NFHD78 [EMAIL PROTECTED] wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Randy Syring Sent: 30 September 2008 07:17 To: sqlalchemy Subject:

[sqlalchemy] SqlAlchemy and kinterbasdb init problem

2008-09-30 Thread Michael Shaw
I am working on two projects that are bothing running under mod_wsgi. The first is using kinterbasdb directly (no sqlalchemy). The second is using sqlalchemy. Problem arises when one or the other attempts to call kinterbasdb.init after the other one has already done so. My question is this: When

[sqlalchemy] enumeration values in the column - referenced from another table

2008-09-30 Thread rca
Hi all, my apologies for a long question, I am new to sqlalchemy and I was struggling with one problem. I solved it but I really not sure it's the right way to do it. The problem is that I need to create objects like this: Token(pos=2, surface=helloWorld) The surface is string, but in the

[sqlalchemy] Re: SqlAlchemy and kinterbasdb init problem

2008-09-30 Thread Michael Bayer
On Sep 30, 2008, at 2:46 PM, Michael Shaw wrote: I am working on two projects that are bothing running under mod_wsgi. The first is using kinterbasdb directly (no sqlalchemy). The second is using sqlalchemy. Problem arises when one or the other attempts to call kinterbasdb.init after the

[sqlalchemy] Re: SqlAlchemy and kinterbasdb init problem

2008-09-30 Thread Michael Shaw
Sorry for not explaining myself more clearly, but the global initialized variable in the kinterbasdb module being set to true (which it should be once initialized) is check first thing when the init method is called. This is supposed to throw a specific programming error. relevant code from

[sqlalchemy] Insert Multiple Items into a list

2008-09-30 Thread Jack Stahl
Hello all, I'd like to use SQL Alchemy to do a single insert with multiple values , such as: INSERT INTO foobar (foo, bar) VALUES ('value1', 0), ('value2', 1); I've found a few ways to do this using a SQLAlchemy connection / the .execute() method on the Insert object. However, my problem is

[sqlalchemy] Re: Insert Multiple Items into a list

2008-09-30 Thread Michael Bayer
On Sep 30, 2008, at 5:52 PM, Jack Stahl wrote: Hello all, I'd like to use SQL Alchemy to do a single insert with multiple values , such as: INSERT INTO foobar (foo, bar) VALUES ('value1', 0), ('value2', 1); I've found a few ways to do this using a SQLAlchemy connection / the

[sqlalchemy] literal sql problem

2008-09-30 Thread mg
I am following the documentation for literal sql and I am getting the following problem: result = session.execute(select * from forwards_history where id=:id, {'id':328}) results in this error: ProgrammingError: (ProgrammingError) syntax error at or near : LINE 1: ...forwards_history where

[sqlalchemy] Re: literal sql problem

2008-09-30 Thread Michael Bayer
On Sep 30, 2008, at 6:45 PM, mg wrote: I am following the documentation for literal sql and I am getting the following problem: result = session.execute(select * from forwards_history where id=:id, {'id':328}) results in this error: ProgrammingError: (ProgrammingError) syntax error