Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-08 Thread Michael Bayer
On Dec 7, 2011, at 11:08 PM, kris wrote: Hmm, I think I want the opposite behavior. I was the defualt mapper to Resource unless a more specific mapper has been defined. I never defined a 'C' or 'D' and I would like simple get a Resource when no better mapper is found. i.e. I get

Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-08 Thread Michael Bayer
the recipe is broken, please wait until i have time to fix it, thanks. On Dec 8, 2011, at 11:27 AM, Michael Bayer wrote: On Dec 7, 2011, at 11:08 PM, kris wrote: Hmm, I think I want the opposite behavior. I was the defualt mapper to Resource unless a more specific mapper has been

Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-08 Thread Michael Bayer
OK it works (not yet in tip though). On Dec 8, 2011, at 11:43 AM, Michael Bayer wrote: the recipe is broken, please wait until i have time to fix it, thanks. On Dec 8, 2011, at 11:27 AM, Michael Bayer wrote: On Dec 7, 2011, at 11:08 PM, kris wrote: Hmm, I think I want the opposite

Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-08 Thread kris
Does this mean I can use this in 7.3? or Do I need to download tip? Also could you show me how this would work with old style mapper(...) s instead of declarative_base? Thanks, Kris -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this

Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-08 Thread Michael Bayer
works in 0.7.3. will also work in 0.7.4 Just not the current tip at the moment. the regular mapper() setup is equivalent (see http://www.sqlalchemy.org/docs/orm/mapper_config.html#classical-mappings) : discriminator_expr = case(...) mapper(Person, ..., polymorphic_on=discriminator_expr,

Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-07 Thread Michael Bayer
On Dec 7, 2011, at 2:53 AM, kris wrote: I am using a single table scheme to store for a set of resource types. I would like to load a specific class if a mapper is defined and use the base class if no more specific version can be found. Is there a way to do this? i.e. resource =

Re: [sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-07 Thread kris
Hmm, I think I want the opposite behavior. I was the defualt mapper to Resource unless a more specific mapper has been defined. I never defined a 'C' or 'D' and I would like simple get a Resource when no better mapper is found. i.e. I get Resource class for C, D and get a Resource_A for A and

[sqlalchemy] Single Table Inheritance, multiple mappers and default (base) mapper

2011-12-06 Thread kris
I am using a single table scheme to store for a set of resource types. I would like to load a specific class if a mapper is defined and use the base class if no more specific version can be found. Is there a way to do this? i.e. resource = Table('resource',