[sqlalchemy] Re: Declaring compound primary key on reflective model

2011-06-12 Thread Cody Django
Thanks! On Jun 10, 1:06 pm, "A.M." wrote: > On Jun 10, 2011, at 2:25 PM, Cody Django wrote: > > > Hi all -- I'm new on pylons, coming from a django background.  I'm > > working on a mapfish project. > > > I'd like to "autoload" a model based on a db table, but in doing so I > > get the error "cou

Re: [sqlalchemy] Help using SqlSoup with database views

2011-06-12 Thread Michael Bayer
map_to() was added in 0.6.6 On Jun 12, 2011, at 11:51 PM, Reece wrote: > Thanks, Michael. > > I'm getting further, but still have an error that I've not been able to > resolve. > > from sqlalchemy.ext.sqlsoup import SqlSoup > from sqlalchemy import Table > u = SqlSoup('postgresql+psycopg2://p

Re: [sqlalchemy] Help using SqlSoup with database views

2011-06-12 Thread Reece
Thanks, Michael. I'm getting further, but still have an error that I've not been able to resolve. from sqlalchemy.ext.sqlsoup import SqlSoup from sqlalchemy import Table u = SqlSoup('postgresql+psycopg2://pub...@unison-db.org:5432/unison') t = Table("pseqalias", u._metadata, autoload=True, schem

[sqlalchemy] Re: Odd behaviour of echo flag

2011-06-12 Thread Vinay Sajip
Thanks for the detailed explanation, Mike. I missed the fact that the Connection gets created at different times in the two scenarios. As expected, moving the echo=True line to just after the commit gives the same result in both scenarios. Regards, Vinay Sajip P.S. I'm reposting this, Google se

Re: [sqlalchemy] Odd behaviour of echo flag

2011-06-12 Thread Michael Bayer
On Jun 12, 2011, at 5:40 AM, Vinay Sajip wrote: > The following short script behaves differently if run with no arguments or > with > arguments: >metadata.bind = "sqlite:tmp/schools.db" the Engine is associated with the MetaData. The echo flag is off. >setup_all(create_tables=True

[sqlalchemy] Odd behaviour of echo flag

2011-06-12 Thread Vinay Sajip
The following short script behaves differently if run with no arguments or with arguments: from elixir import * import os from sqlalchemy import Unicode, select, and_, __version__ import sys class School(Entity): name = Field(Unicode(50), required=True) class Subject(Entity): name = Fiel