Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2010-01-12 Thread Chris Withers
Michael Bayer wrote: 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

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2010-01-12 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: 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

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2010-01-01 Thread Chris Withers
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

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2010-01-01 Thread Michael Bayer
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

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-30 Thread Chris Withers
Michael Bayer wrote: Michael Bayer wrote: The Column objects you declare within declarative become members of the underlying Table object, so its not as simple as just having those members present on a mixin - what would really be needed would be some sort of copying of each column object

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-30 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Michael Bayer wrote: The Column objects you declare within declarative become members of the underlying Table object, so its not as simple as just having those members present on a mixin - what would really be needed would be some sort of copying of

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-30 Thread Chris Withers
Michael Bayer wrote: Uh oh: sqlalchemy.exc.ArgumentError: Mapper Mapper|Employee|employee could not assemble any primary key columns for mapped table 'employee' ...which makes me wonder if the class decorator would actually work at all. Surely it'll only kick in after the DeclarativeMeta

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-30 Thread Michael Bayer
Chris Withers wrote: But agreed, make your mixin implement a marker class from the declarative module (MixinsDeclarative, i dunno), How about just a marker attribute? How about something in __mapper__args__, which already exists? class MyMixin: __mapper_args__ = {'abstract':True}

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-17 Thread Chris Withers
(sorry, missed this earlier) Michael Bayer wrote: The Column objects you declare within declarative become members of the underlying Table object, so its not as simple as just having those members present on a mixin - what would really be needed would be some sort of copying of each column

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-17 Thread Michael Bayer
On Dec 17, 2009, at 1:59 PM, Chris Withers wrote: (sorry, missed this earlier) Michael Bayer wrote: The Column objects you declare within declarative become members of the underlying Table object, so its not as simple as just having those members present on a mixin - what would really be

[sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-13 Thread Daishy
Hi together, I'm sorry if this is a rather stupid question, but i havent found a solution yet :/ I have a few models build with the DeclarativeBase-Class. Now each of these models has a few columns that they have in common (created_by, created_at, updated_by, updated_at). Rather than putting the

Re: [sqlalchemy] DeclarativeBase and multiple inheritance

2009-12-13 Thread Michael Bayer
On Dec 13, 2009, at 12:09 PM, Daishy wrote: Hi together, I'm sorry if this is a rather stupid question, but i havent found a solution yet :/ I have a few models build with the DeclarativeBase-Class. Now each of these models has a few columns that they have in common (created_by,