[sqlalchemy] what attributes are allowed for column_mapped_collection?

2009-02-27 Thread robert rottermann
Hi there, I would like to have a dictionary like collection based on one of the collections provided by sa like attribute_mapped_collection. now my question: May I use id which is autogenerated and primary key as the controlling attribute of the collection like: flagged_companies =

[sqlalchemy] Re: Class.query vs DBSession.query(Class)

2009-02-27 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Sanjay Sent: 27 February 2009 05:52 To: sqlalchemy Subject: [sqlalchemy] Class.query vs DBSession.query(Class) Hi, There are two styles of writing code for querying: the

[sqlalchemy] Script to automatically generate SA classes.

2009-02-27 Thread Piotrek Byzia
Hi, I bet that not only me is bored by having to write manually all the SA mappings and class definitions. Do you know any script which could automate this? For example based on some simplified definitions written in YAML, JSON (or XML, but this would be longer to write than actual code

[sqlalchemy] Re: Script to automatically generate SA classes.

2009-02-27 Thread Michael Bayer
Piotrek Byzia wrote: Hi, I bet that not only me is bored by having to write manually all the SA mappings and class definitions. there's a tool out there somewhere called autocode that does something like this. But I never get bored writing mapped classes. That's the domain model for my

[sqlalchemy] Re: Sybase DB-API driver uses @foo for placeholder names and expect parameter dict keys to be similarly named

2009-02-27 Thread phrrn...@googlemail.com
How does one deal with driver-specific unit tests? I am running in difficulties in testing the pyodbc and python-sybase drivers for the sybase dialect. For example, test_raw_qmark works with the pyodbc driver (as it supports that style) but not with the python-sybase driver. Is there some

[sqlalchemy] Re: Sybase DB-API driver uses @foo for placeholder names and expect parameter dict keys to be similarly named

2009-02-27 Thread Michael Bayer
phrrn...@googlemail.com wrote: How does one deal with driver-specific unit tests? I am running in difficulties in testing the pyodbc and python-sybase drivers for the sybase dialect. For example, test_raw_qmark works with the pyodbc driver (as it supports that style) but not with the

[sqlalchemy] Re: Script to automatically generate SA classes.

2009-02-27 Thread phrrn...@googlemail.com
I think that the SQL Alchemy SchemaItem objects can be reasonably code- generated from the schema. I don't feel the same way about the mapped classes: the naming of classes and the naming of the various relations is something that benefits from some thought and design, more than seems practical

[sqlalchemy] Re: Sybase DB-API driver uses @foo for placeholder names and expect parameter dict keys to be similarly named

2009-02-27 Thread phrrn...@googlemail.com
I want to automatically set IDENTITY_INSERT for a table if the identity column is explicitly listed. Likewise, after execution of an insert on a table with an identity column we want to retrieve the identity value. Any idea why the following code would cause the connection to be checked in

[sqlalchemy] Re: Sybase DB-API driver uses @foo for placeholder names and expect parameter dict keys to be similarly named

2009-02-27 Thread Michael Bayer
phrrn...@googlemail.com wrote: I want to automatically set IDENTITY_INSERT for a table if the identity column is explicitly listed. Likewise, after execution of an insert on a table with an identity column we want to retrieve the identity value. Any idea why the following code would cause

[sqlalchemy] Re: Sybase DB-API driver uses @foo for placeholder names and expect parameter dict keys to be similarly named

2009-02-27 Thread phrrn...@googlemail.com
Yes, it is based off the mssql code but I made some modifications to it to take care of situations like, for example, where there is an identity column but it is not the primary key (and hence not a 'sequence'). This means a read off the catalog to find the identity column (I believe that only

[sqlalchemy] Re: Sybase DB-API driver uses @foo for placeholder names and expect parameter dict keys to be similarly named

2009-02-27 Thread Michael Bayer
phrrn...@googlemail.com wrote: Yes, it is based off the mssql code but I made some modifications to it to take care of situations like, for example, where there is an identity column but it is not the primary key (and hence not a 'sequence'). This means a read off the catalog to find the