[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread az
hm i had not run my tests for quite a while.. this seems recent thing. lets see if i can dig anything of help... nothing much, one side works, another not at all. one of my set of inheritance tests (direct over sa, A-B) is ok. the other one (over dbcook) fails completely, even for A-B

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Michael Bayer
um yeah, actually this behavior is affecting all multi-level usage of polymorphic_union. So, while polymorphic_union is quite obviously (since nobody has noticed this pretty glaring issue) on the decline in the 0.5 series, this is quite severe and ill try to have a look at it today. On

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Gaetan de Menten
On Wed, Dec 3, 2008 at 15:03, Michael Bayer [EMAIL PROTECTED] wrote: um yeah, actually this behavior is affecting all multi-level usage of polymorphic_union. So, while polymorphic_union is quite obviously (since nobody has noticed this pretty glaring issue) on the decline in the 0.5

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Michael Bayer
this ones big, i can handle it. the attached patch makes your case work, but the problem represented here still makes itself apparent in other ways and I havent strength tested this patch. you might want to see if this patch works in all of your test cases.

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Gaetan de Menten
On Wed, Dec 3, 2008 at 16:04, Michael Bayer [EMAIL PROTECTED] wrote: this ones big, i can handle it. the attached patch makes your case work, but the problem represented here still makes itself apparent in other ways and I havent strength tested this patch. you might want to see if this

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Michael Bayer
it needed some more work. the final version of this fix is in r5412. On Dec 3, 2008, at 10:49 AM, Gaetan de Menten wrote: On Wed, Dec 3, 2008 at 16:04, Michael Bayer [EMAIL PROTECTED] wrote: this ones big, i can handle it. the attached patch makes your case work, but the problem

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread az
this is still there:   File sqlalchemy/orm/mapper.py, line 168, in __init__     self.with_polymorphic[1] = self.with_polymorphic[1].alias() TypeError: 'tuple' object does not support item assignment also, related question: once there is A-B-C, concrete, how u'd get some A by id?

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread az
and maybe related: def query_by_id( klas, idname, oid, .): q = session.query( klas).filter_by( **{idname: oid}) # filter by atype for concrete m = class_mapper( klas) concrete = bool( m.with_polymorphic[1] ) if concrete: q= q.filter( m.polymorphic_on ==

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Michael Bayer
thats strange, i dont suppose you could send me how you're setting up that polymorphic union On Dec 3, 2008, at 3:05 PM, [EMAIL PROTECTED] wrote: and maybe related: def query_by_id( klas, idname, oid, .): q = session.query( klas).filter_by( **{idname: oid}) # filter by atype

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread az
can i... maybe something like table_A = Table( 'A', meta, Column( 'name', String(length=200, ), ), Column( 'db_id', primary_key= True, type_= Integer, ), ) table_B = Table( 'B', meta, Column( 'dataB', String(length=200 ),

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread az
this is still there: File sqlalchemy/orm/mapper.py, line 168, in __init__ self.with_polymorphic[1] = self.with_polymorphic[1].alias() TypeError: 'tuple' object does not support item assignment try mapping to something that is already an alias() (this would lend insight into your

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Michael Bayer
On Dec 3, 2008, at 3:45 PM, [EMAIL PROTECTED] wrote: okay, then i get this as answer to my other question - so concrete polymorhism relations/get()/identity on top of it are blue_sky. that's okay - just put a line about it in the docs. dbcook is throwing warnings about it since long time.

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread az
On Wednesday 03 December 2008 23:28:01 Michael Bayer wrote: On Dec 3, 2008, at 3:45 PM, [EMAIL PROTECTED] wrote: okay, then i get this as answer to my other question - so concrete polymorhism relations/get()/identity on top of it are blue_sky. that's okay - just put a line about it in the

[sqlalchemy] Re: Polymorphic concrete inheritance question

2008-12-03 Thread Michael Bayer
On Dec 3, 2008, at 5:15 PM, [EMAIL PROTECTED] wrote: On Wednesday 03 December 2008 23:28:01 Michael Bayer wrote: On Dec 3, 2008, at 3:45 PM, [EMAIL PROTECTED] wrote: okay, then i get this as answer to my other question - so concrete polymorhism relations/get()/identity on top of it are