On Jan 1, 2010, at 5:09 PM, Chris Withers wrote:

> Michael Bayer wrote:
>> well mapper_args is args that go to the mapper.   Its a little unclean
>> IMHO to reuse that same dict for declarative purposes.   Id rather have
>> another attribute like __declarative_abstract__ = True or something like
>> that (ideas welcome).
> 
> __declaratice_abstract__ = True works for me :-)
> 
>>> What to do in the meantime? The class decorator felt really quite neat
>>> except that it won't work where primary key columns are added by the
>>> decorator, right?
>> 
>> yeah the class decorator can't really handle the PKs.  the mapper wants
>> those when it starts up.  
> 
> Metaclass it is then. I asked a while back but I think it got lost in 
> the melee: is it okay to have several declarative bases knocking around 
> or will they each end up with their own metadata collection causing 
> problems when models from one have relations to models from another?
> 
>> as far as implementation this feature isn't on
>> my personal radar, so if you really want anytime soon you should provide a
>> patch, which I can of course help with.
> 
> Cool, it is on my radar, but sadly pretty far away :-(

you know, doing the "metaclass" approach is probably the first part of doing 
the "demarcated mixin" approach.

here it is:  http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DeclarativeMixins


--

You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.


Reply via email to