[sqlalchemy] Re: Copy of a table with a different name

2008-07-17 Thread Artur Siekielski
> send along a test case that includes whatever ForeignKey references to/ > from ObjectType might be involved here.    My initial guess might be   > to lose the "constraints.copy()" section since each Column.copy() will   > contain a copied ForeignKey inside of it.  copy() has only been used   > b

[sqlalchemy] correlated update across logical databases

2008-07-17 Thread Ryan Tracey
Hi I would like to do a correlated update involving tables located in two logical databases on the same MySQL server. The commented out code below would work except that the mysql ends up looking for the one table in the wrong database. customer is defined as Table('customer', ps_final_meta, aut

[sqlalchemy] Re: correlated update across logical databases

2008-07-17 Thread Michael Bayer
On Jul 17, 2008, at 7:12 AM, Ryan Tracey wrote: > > Hi > > I would like to do a correlated update involving tables located in two > logical databases on the same MySQL server. > > The commented out code below would work except that the mysql ends up > looking for the one table in the wrong datab

[sqlalchemy] Re: Data Inheritance

2008-07-17 Thread Michael Bayer
On Jul 16, 2008, at 3:29 PM, laureano arcanio wrote: > Hi, I'm planning to implement Data inheritance for an os project i'm > working on [1]. I have a model with a few tables and relationships > between them ( not a complicated stuff ) and i was wandering if > there is a way to accomplish

[sqlalchemy] Re: subclassing Table

2008-07-17 Thread Michael Bayer
On Jul 16, 2008, at 4:43 PM, Tamas wrote: > > Hi, > > I am not a professional coder; hobby-like thing. > I would like to encapsulate my table definitions in a new class: > > class MyTable( Table): > def __init__( self, metadata): > Table.__init__( self, my_table_name, metadata, col1, col2.

[sqlalchemy] Re: subclassing Table

2008-07-17 Thread Tamas Hegedus
Thanks a lot! I think your suggestion will be ok for me for now. Have a good day, tamas On Thu, Jul 17, 2008 at 9:55 AM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On Jul 16, 2008, at 4:43 PM, Tamas wrote: > > > > > Hi, > > > > I am not a professional coder; hobby-like thing. > > I would like

[sqlalchemy] Session query timeout

2008-07-17 Thread Chris
Hi all, I'm using SQLAlchemy to access a large table (~280 million rows), and I'm getting timeout issues. At 30 seconds, SQLAlchemy quits. In lieu of getting all tables past and future to be indexed differently, I was wondering if there was a way using session.query (*not* select()) to change th

[sqlalchemy] Re: Data Inheritance

2008-07-17 Thread laureano arcanio
Thanks Michael. I might not explain it well, but I've traying to make some kind of data ( rows ) inheritance, this is "copying" a table value and all it's related childrens, and modify it as necesary with new values in an automated way. ( not inherit Table structures ) It's looks weird i think, I'

[sqlalchemy] Re: Session query timeout

2008-07-17 Thread Michael Bayer
On Jul 17, 2008, at 9:24 AM, Chris wrote: > > Hi all, I'm using SQLAlchemy to access a large table (~280 million > rows), and I'm getting timeout issues. At 30 seconds, SQLAlchemy > quits. In lieu of getting all tables past and future to be indexed > differently, I was wondering if there was a

[sqlalchemy] Re: Data Inheritance

2008-07-17 Thread az
On Thursday 17 July 2008 17:06:14 laureano arcanio wrote: > Thanks Michael. I might not explain it well, but I've traying to > make some kind of data ( rows ) inheritance, this is "copying" a > table value and all it's related childrens, and modify it as > necesary with new values in an automated

[sqlalchemy] KeyError with SA 0.4.6 and Elixir 0.5.2

2008-07-17 Thread Venkatesh
Hello all, I'm using SQLAlchemy 0.4.6 with Elixir 0.5.2 I'm having intermittent trouble when I've spread the Elixir classes across multiple files. In my example, I've declared classes in User.py --> class User(elixir.entity) Credential.py --> class Credential(elixir.entity) AccessGrant.py -->

[sqlalchemy] Declarative 0.5 tutorial fails to create tables before insert

2008-07-17 Thread Kris Kennaway
Hi, I'm trying to follow the "declarative" example in the tutorial with 0.5.0b2, and it's failing to work: from sqlalchemy import create_engine engine = create_engine('sqlite:///:memory:', echo=True) from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey from sqlalchemy.e

[sqlalchemy] Re: Declarative 0.5 tutorial fails to create tables before insert

2008-07-17 Thread Michael Bayer
On Jul 17, 2008, at 4:44 PM, Kris Kennaway wrote: > > > from sqlalchemy.orm import sessionmaker > Session = sessionmaker(bind=engine) > session = Session() > > ed_user = User('ed', 'Ed Jones', 'edspassword') > session.add(ed_user) > > session.add_all([ > User('wendy', 'Wendy Williams', '