Ignore typos in the Python source. I just saw this. > global_connect('postgres://database==mydb')
I wrote this up in mutt, actually VIM, and didn't run it, but it should get the point across. Randall On Wed, Apr 26, 2006 at 04:04:22PM -0500, Randall Smith wrote: > I'm very new to sqlalchemy. It solves some problems I couldn't solve > well with SQLObject. The Table == Class line of thought was preventing > me from doing lots of things. Anyhow, to my first issue. > > I will treat my sqlalchemy creations as a library and use them with > various database connection types. All of my tables (200+) live in > schemas other than the default schema, so I define them with > schema='myschema'. I'm using global_connect to set up my connection at > runtime, but my table definitions want a connection when they're > initiated for the schema attribute. If I remove the schema attribute, > no problem. So here's an example that will fail. > > from sqlalchemy import * > > mytable = Table('mytablename', > Column('id', Integer, primary_key=True), > Column('name', String(), nullable=False), > schema='myschema' > ) > > class MyTable(object): > pass > > assign_mapper(MyTable, mytable) > > global_connect('postgres://database==mydb') > > > Why do I need a connection to define schema? That don't make no sense > :) > > Randall > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users