[sqlalchemy] Re: null() and notnull()

2009-03-20 Thread jo
Michael Bayer ha scritto: On Mar 19, 2009, at 12:34 PM, jo wrote: Michael Bayer wrote: why dont you just stick with None instead of nn ? then you just write: if v is None: clause.append(self.c.field != v) else: clause.append(self.c.field == v) It could be an

[sqlalchemy] Querying many-to-many relations

2009-03-20 Thread Marcin Krol
Hello, I have defined following many to many relation: email_table = Table('email',md, Column('id',Integer,primary_key=True), Column('Email',String)) project_table = Table('project',md, Column('id',Integer,primary_key=True), Column('Project',String)) hwrep_table = Table('hwrep',md,

[sqlalchemy] Re: Querying many-to-many relations

2009-03-20 Thread Ants Aasma
On Mar 20, 12:54 pm, Marcin Krol mrk...@gmail.com wrote: However, I have a problem doing a query at SQLA level that will select email, hwrep name and project name. The simple SQL query is straightforward: select email.Email, project.Project, hwrep.HWRep from email, project, hwrep,  

[sqlalchemy] Re: Working around capitalization problems moving from MySQL to Oracle

2009-03-20 Thread loctones
a search and replace of all your CamelCase names is definitely the   simplest way around this issue.   Alternatively you would have to   forego the usage of reflection and rename your attributes using key: Thanks, Michael. I will go with the search and replace method. The mapper method was

[sqlalchemy] Why sqlalchemy.orm.properties.RelationProperty haven't info attribute to store application specific data like Column class ?

2009-03-20 Thread KLEIN Stéphane
Hi, The Column class have info attribute (http://www.sqlalchemy.org/ docs/04/sqlalchemy_schema.html#docstrings_sqlalchemy.schema_Column). :: info Defaults to {}: A space to store application specific data; this must be a dictionary Now I don't understand why

[sqlalchemy] Mixing horizontal and vertical partitioning

2009-03-20 Thread Jacob Gabrielson
Does anyone have any suggestions for managing both horizontal and vertical partitioning within the same application? In particular I'd prefer that most of my code be oblivious to all this and only use a single session object. To make it a little more concrete, imagine I have four tables in my

[sqlalchemy] 0.5.2 seems to always roll back with mssql

2009-03-20 Thread davidlmontgomery
I'm using sqlalchemy with sql server express. Client-side is also Windows, running python 2.5.2. I find that all my changes get rolled back when using 0.5.2. But using 0.4.8, things work as I expect. Here is an example script: --- start script --- import datetime import sqlalchemy from

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-20 Thread Mike Conley
Have you tried adding echo=True to the engine to observe the actual SQL? -- Mike Conley On Fri, Mar 20, 2009 at 8:23 PM, davidlmontgomery davidlmontgom...@gmail.com wrote: I'm using sqlalchemy with sql server express. Client-side is also Windows, running python 2.5.2. I find that all

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-20 Thread Michael Bayer
On Mar 20, 2009, at 8:23 PM, davidlmontgomery wrote: Running this I'll get count: 1 (assuming a clean sa_test table), showing that the insert occurred. But then looking in the database, I'll see that the data aren't there (with 0.5.2; with 0.4.8 the data will be there). The same thing

[sqlalchemy] Re: Mixing horizontal and vertical partitioning

2009-03-20 Thread Michael Bayer
On Mar 20, 2009, at 4:43 PM, Jacob Gabrielson wrote: Does anyone have any suggestions for managing both horizontal and vertical partitioning within the same application? In particular I'd prefer that most of my code be oblivious to all this and only use a single session object. To make

[sqlalchemy] Re: Why sqlalchemy.orm.properties.RelationProperty haven't info attribute to store application specific data like Column class ?

2009-03-20 Thread Michael Bayer
Column is a Table/SQL level object which is assembled into a fixed structure, and relation() is ORM level object assembling itself onto a mapped class which can be of any design.your mapped class should provide other ways independent of the ORM with which to represent information