[sqlalchemy] Re: Creating tables in correct order

2010-11-08 Thread Gunnlaugur Briem
Hi, that example code works for me in PostgreSQL, after adding unique=True on the name attribute of User, and reversing the order of the drop calls. I don't have a MySQL to try against. Did you get the exact same error from it when running against MySQL? As for your actual app: 1. the log

[sqlalchemy] Delete and Concrete Table Inheritance

2010-11-08 Thread Mene
Hi all, I have some 'child' tables which inherit from the same 'master' table, now I'd like to delete some entries from all tables. The 'where'-part comes solely from the master table. I have decided to use Concrete Table Inheritance since I don't need the inheritance at points other than

[sqlalchemy] Avoiding float results using autoload=True with Oracle and sqlalchemy 0.6.5

2010-11-08 Thread ACB
sqlalchemy version 0.5.3 sqlalchemy.text() used to return float results when the database type was numeric while sqlalchemy.select() would return decimal results, which was the desired result. In order to avoid this I used an output type handler to ensure that all NUMERIC results from the

[sqlalchemy] Database Views

2010-11-08 Thread Adrian
Hi all, This is a topic that has been discussed before, but I haven't been able to successfully implement any of the proposed solutions in my own code. I've created a few Views in my postgres database, and I'm looking for a way to simply query them from sqlalchemy. I tried just treating them as

Re: [sqlalchemy] Database Views

2010-11-08 Thread A.M.
On Nov 8, 2010, at 1:16 PM, Adrian wrote: Hi all, This is a topic that has been discussed before, but I haven't been able to successfully implement any of the proposed solutions in my own code. I've created a few Views in my postgres database, and I'm looking for a way to simply query

Re: [sqlalchemy] Avoiding float results using autoload=True with Oracle and sqlalchemy 0.6.5

2010-11-08 Thread Michael Bayer
On Nov 8, 2010, at 11:59 AM, ACB wrote: sqlalchemy version 0.5.3 sqlalchemy.text() used to return float results when the database type was numeric while sqlalchemy.select() would return decimal results, which was the desired result. In order to avoid this I used an output type handler to

Re: [sqlalchemy] Database Views

2010-11-08 Thread Michael Bayer
On Nov 8, 2010, at 1:16 PM, Adrian wrote: Hi all, This is a topic that has been discussed before, but I haven't been able to successfully implement any of the proposed solutions in my own code. I've created a few Views in my postgres database, and I'm looking for a way to simply query

Re: [sqlalchemy] Delete and Concrete Table Inheritance

2010-11-08 Thread Michael Bayer
On Nov 8, 2010, at 11:02 AM, Mene wrote: Hi all, I have some 'child' tables which inherit from the same 'master' table, now I'd like to delete some entries from all tables. The 'where'-part comes solely from the master table. I have decided to use Concrete Table Inheritance since I don't

Re: [sqlalchemy] table updates + missing 'from'

2010-11-08 Thread Michael Bayer
On Nov 8, 2010, at 2:33 PM, Jon Nelson wrote: I'd like to translate a SQL statement: UPDATE foo SET colA = bar.colB FROM bar WHERE foo.colC = bar.colC; I get this far, but am not sure how to add the FROM: stmt = foo_table.update()\ .where( foo_table.c.colC == bar_table.c.colC )\

[sqlalchemy] Re: Database Views

2010-11-08 Thread Adrian
Thanks for the quick reply, this is exactly what I was looking for! Thanks again, Adrian On Nov 8, 2:29 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 8, 2010, at 1:16 PM, Adrian wrote: Hi all, This is a topic that has been discussed before, but I haven't been able to

[sqlalchemy] sqla and firebird

2010-11-08 Thread Domingo Aguilera
Is firebird 2.5 working with sqla. ? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more

[sqlalchemy] (Newbie) Using a custom collection extending from a dict(). Is that doable?

2010-11-08 Thread Hector Blanco
Hello everyone... I'm trying to use a custom collection to connect (or relate) two classes but I haven't been able to do it. Maybe I got the whole concept of the custom collections wrong, but let me explain what I am doing (and see if someone can give me a hint, or something) I have a Parent

[sqlalchemy] polymorphic_identity not recognized with non-primary mapper

2010-11-08 Thread William
When I create a non-primary mapper for my class to add an additional computed value in certain contexts when the query runs I get the error: AssertionError: No such polymorphic_identity 'M' is defined This works fine with the primary mapper as several classes are defined as having polymorphic

Re: [sqlalchemy] polymorphic_identity not recognized with non-primary mapper

2010-11-08 Thread Michael Bayer
On Nov 8, 2010, at 6:17 PM, William wrote: When I create a non-primary mapper for my class to add an additional computed value in certain contexts when the query runs I get the error: AssertionError: No such polymorphic_identity 'M' is defined This works fine with the primary mapper as

Re: [sqlalchemy] sqla and firebird

2010-11-08 Thread Michael Bayer
not sure if anyone knows. I have 2.1 running here for my own tests. On Nov 8, 2010, at 5:05 PM, Domingo Aguilera wrote: Is firebird 2.5 working with sqla. ? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] Re: sqla and firebird

2010-11-08 Thread Domingo Aguilera
I've been working with a client server GUI app that uses sqlalchemy to handle many backends ( sqlserver, mysql, postgresql , etc ). Now one customer wants that app running with firebird. When I create the tables it seems that primary keys columns are not using generators ( which is the thing

Re: [sqlalchemy] Re: sqla and firebird

2010-11-08 Thread Michael Bayer
the FB dialect uses sequences. You have to use the Sequence() construct on your PK columns with Firebird. On Nov 8, 2010, at 8:32 PM, Domingo Aguilera wrote: I've been working with a client server GUI app that uses sqlalchemy to handle many backends ( sqlserver, mysql, postgresql , etc ).

[sqlalchemy] Re: polymorphic_identity not recognized with non-primary mapper

2010-11-08 Thread William
Ahhh, thank you very much, the following seems to be working for me now: results = Session.query(Content, Column('distance', Float))\ .from_statement(text(stmt)).all() contents = [] for content, distance in results: content.distance = distance

[sqlalchemy] Re: sqla and firebird

2010-11-08 Thread Domingo Aguilera
I wonder if you have a very simple example of this. Tks in advance. On Nov 8, 8:13 pm, Michael Bayer mike...@zzzcomputing.com wrote: the FB dialect uses sequences.  You have to use the Sequence() construct on your PK columns with Firebird. On Nov 8, 2010, at 8:32 PM, Domingo Aguilera wrote:

[sqlalchemy] Re: sqla and firebird

2010-11-08 Thread Domingo Aguilera
Forget about this Michael, I've found the way. i.e. id = Column( Integer, Sequence( column_seq_id, optional = True ), primary_key = True ) On Nov 8, 8:27 pm, Domingo Aguilera domingo.aguil...@gmail.com wrote: I wonder if you have a very simple example of this.  Tks in advance. On Nov 8,

[sqlalchemy] Does SQLAlchemy support read-write splitting?

2010-11-08 Thread Li-Wen Hsu
Hello, Does SQLAlchemy support read-write splitting? It seems not mentioned in the document. Or does it is not intended to support in ORM layer? This is somehow important for scaling , and could be convenient if we can achieve this in SQLAlchemy. Thanks, Li-Wen -- You received this message