Re: [sqlalchemy] ClassManager.new_instance does not longer initialize polymorphic column

2012-02-01 Thread Torsten Landschoff
Hi Michael, On Tue, 2012-01-31 at 10:26 -0500, Michael Bayer wrote: If you're using new_instance() to create the instance, then you are deserializing data from somewhere, why isn't the discriminator value, which is after all one of the column values in the table, not present in this

[sqlalchemy] Possible bug with join condition on self-referential outer joins

2012-02-01 Thread Pau Tallada
Hi! I have a table with a self-reference of two columns that represents a tree structure. I was trying to build an outerjoin to select all the nodes have children but NO grandchildren, but the SQL constructed was incorrect, as it was not aliasing properly one of the columns. note_t

Re: [sqlalchemy] Overload Query Object

2012-02-01 Thread Christian Démolis
Hi, right, it's that thanks 2012/1/31 Tate Kim insight...@gmail.com ** Hi, Have you checked the __iter__ method ? -- *From: * Christian Démolis christiandemo...@gmail.com *Sender: * sqlalchemy@googlegroups.com *Date: *Tue, 31 Jan 2012 17:39:54 +0100 *To:

[sqlalchemy] Python 2.7.1 + SQLAlchemy 0.6.8 + Kinterbasdb == (error) argument for 's' must be a string None None

2012-02-01 Thread León Domingo
Hi, I'm trying to use Python 2.7.1 + SA 0.6.8 + kinterbasdb (3.3.0) and I'm always getting the same error when I try to do some query: File /home/leon/app/env/tg2/local/lib/python2.7/site-packages/ kinterbasdb/__init__.py, line 1695, in addString newEntry = struct.pack(format, codeAsByte,

[sqlalchemy] Re: Python 2.7.1 + SQLAlchemy 0.6.8 + Kinterbasdb == (error) argument for 's' must be a string None None

2012-02-01 Thread León Domingo
Forget it... I was passing the url as a unicode string because I saw some warnings in the past with postgresql. The same thing makes kinterbasdb (firebird) fail. León Domingo Ender - Factoría de Software leon.domi...@ender.es jestre...@ender.es Avda. Cerro del Águila, 7. S23 - 2ª Planta 28703

[sqlalchemy] Best practices for SaaS application

2012-02-01 Thread Samir Mamude
Hello, I have an application SaaS with mongodb and I need to change to sqlalchemy using postgresql or mysql. My requirements are: What the best options for SaaS app with sqlalchemy? - Should I use 1 database per customer. - Sharding. - Schema per customer (postgresql) with subdomain (my current

Re: [sqlalchemy] Possible bug with join condition on self-referential outer joins

2012-02-01 Thread Michael Bayer
This is essentially ticket #1401 and I've attached this there as well as moved up the priority, however this issue is extremely complicated and would require some serious rethinking of the relationship()'s inner workings.It would take several days to come up with a general solution so I

[sqlalchemy] Relationship definition problem

2012-02-01 Thread Thijs Engels
I am currently facing a problem with a legacy database for which I am creating a SQLAlchemy layer. With regards to mirroring the columns everything goes well. However I am having difficulties defining a relationship which is not many-to-many, but does use something which can be compared with an

Re: [sqlalchemy] Relationship definition problem

2012-02-01 Thread Michael Bayer
On Feb 1, 2012, at 11:14 AM, Thijs Engels wrote: In short; the Area class has a multi-column primary key (sesseion_id, area_id). I am trying to create the relationship for area in the Child class, however this would need the session_id which can be found in the parent class. This was my last

Re: [sqlalchemy] What's the idiomatic way of writing INSERT... ON DUPLICATE KEY UPDATE

2012-02-01 Thread Michael Bayer
assuming this is the same thing asked on reddit: http://www.reddit.com/r/Python/comments/p5grh/sqlalchemy_whats_the_idiomatic_way_of_writing/ I mentioned ticket #960 as where we'd someday support MERGE and its variants, but this can also be rolled with @compiles, see the example in that ticket.

Re: [sqlalchemy] What's the idiomatic way of writing INSERT... ON DUPLICATE KEY UPDATE

2012-02-01 Thread Didip Kerabat
Correct, the same guy. Thank you for the pointer! Today I learned about the compiles decorator. - Didip - On Feb 1, 2012, at 10:56 AM, Michael Bayer wrote: assuming this is the same thing asked on reddit:

[sqlalchemy] Re: session.query().get() is unsupported during flush for getting an object that was just added?

2012-02-01 Thread Kent
If the value is based on what's already been INSERTed for previous rows, I'd emit a SQL statement to get at the value.If it's based on some kind of natural consideration that isn't dependent on the outcome of an INSERT statement, then you can do the looping above within the