[sqlalchemy] Re: polymorphic_union and key

2008-10-21 Thread Eric Lemoine
On Mon, Oct 20, 2008 at 7:46 PM, Michael Bayer [EMAIL PROTECTED] wrote: its not a known issue but sounds like a bug. a very concise test case which we can use as a unit test would help here. I hope this is good enough: from sqlalchemy import * from sqlalchemy.orm import * engine =

[sqlalchemy] fail to make an custom type

2008-10-21 Thread alex bodnaru
hello friends, i'm trying to use a custom type, as illustrated in http://www.sqlalchemy.org/docs/05/types.html, but neither the old convert_bind_param and convert_result_value, nor the newer process_bind_param and process_result_value to not appear to be invoked when i manipulate the type. the

[sqlalchemy] Re: fail to make an custom type

2008-10-21 Thread alex bodnaru
found my fault. i have used elixir in a deprecated way, so the error has been masked. reposting correct code. it may still work the older way too. thanks, alex On Tue, Oct 21, 2008 at 10:25, alex bodnaru [EMAIL PROTECTED] wrote: hello friends, i'm trying to use a custom type, as illustrated

[sqlalchemy] Re: polymorphic_union and key

2008-10-21 Thread az
concrete polymorphism with good deal of inheritance and same-keys does not work in current SA. there's no way to differ between X.id=1 and Y.id=1 in the polymunion. there were ideas to add some type-discriminator in the union's primary key, and use that in the machinery, but AFAIK no much is

[sqlalchemy] foreign_keys question

2008-10-21 Thread Marin
I am using SA to map existing tables from my database. I have mapped the whole database without using any foreign_key argument for the mapper properties. After adding 3 new tables with corresponding foreign keys, SA is forcing me to add the foreign_key argument for the new mappings. Is there a

[sqlalchemy] Re: foreign_keys question

2008-10-21 Thread Michael Bayer
On Oct 21, 2008, at 9:41 AM, Marin wrote: I am using SA to map existing tables from my database. I have mapped the whole database without using any foreign_key argument for the mapper properties. After adding 3 new tables with corresponding foreign keys, SA is forcing me to add the

[sqlalchemy] query(polymunion) .select_from( another polymunion)

2008-10-21 Thread az
hi in a class hierarcy A,B,C,... in order to get all things that are instances of a subclass of A but not A itself, i used somequery().from-statement( subfilter). then i found select_from() which allows to do further joins/filter etc and now use that. but it won't work for polymorphic

[sqlalchemy] Re: polymorphic_union and key

2008-10-21 Thread Eric Lemoine
I have to check but I think I get the same error if I name the keys differently in each table. Eric 2008/10/21, [EMAIL PROTECTED] [EMAIL PROTECTED]: concrete polymorphism with good deal of inheritance and same-keys does not work in current SA. there's no way to differ between X.id=1 and

[sqlalchemy] Advanced? mapping question

2008-10-21 Thread Hinrich
Hi, I have a problem that I can't figure out how to solve. I am really hoping that somebody could point me in the right direction. Here is my setup: patient_base_data = Table('Datenbestand', db.metadata, Column('IDPat', Integer, primary_key=True),

[sqlalchemy] Advanced? mapping question

2008-10-21 Thread Hinrich Winther
Hi, I have a problem that I can't figure out how to solve. I am really hoping that somebody could point me in the right direction. Here is my setup: patient_base_data = Table('Datenbestand', db.metadata, Column('IDPat', Integer, primary_key=True),

[sqlalchemy] Re: Advanced? mapping question

2008-10-21 Thread Michael Bayer
On Oct 21, 2008, at 11:33 AM, Hinrich Winther wrote: Hi, I have a problem that I can't figure out how to solve. I am really hoping that somebody could point me in the right direction. Here is my setup: patient_base_data = Table('Datenbestand', db.metadata,

[sqlalchemy] Re: query(polymunion) .select_from( another polymunion)

2008-10-21 Thread Michael Bayer
On Oct 21, 2008, at 11:28 AM, [EMAIL PROTECTED] wrote: hi in a class hierarcy A,B,C,... in order to get all things that are instances of a subclass of A but not A itself, i used somequery().from-statement( subfilter). then i found select_from() which allows to do further joins/filter etc

[sqlalchemy] Re: polymorphic_union and key

2008-10-21 Thread Michael Bayer
I forgot to mention i fixed this for 0.4 + 0.5 in r5180/5181...thanks for the test ! On Oct 21, 2008, at 3:48 AM, Eric Lemoine wrote: On Mon, Oct 20, 2008 at 7:46 PM, Michael Bayer [EMAIL PROTECTED] wrote: its not a known issue but sounds like a bug. a very concise test case which we

[sqlalchemy] Re: polymorphic_union and key

2008-10-21 Thread Eric Lemoine
Great. Thanks! 2008/10/22, Michael Bayer [EMAIL PROTECTED]: I forgot to mention i fixed this for 0.4 + 0.5 in r5180/5181...thanks for the test ! On Oct 21, 2008, at 3:48 AM, Eric Lemoine wrote: On Mon, Oct 20, 2008 at 7:46 PM, Michael Bayer [EMAIL PROTECTED] wrote: its not a known