On Wednesday 17 December 2008 09:28:34 Joril wrote: > Michael Bayer ha scritto: > > "concrete inheritance", as referenced in that post, was not > > designed to be used as a configurational spacesaver and always > > requires a mapped selectable for the "base", which you don't have > > here, so it's not appropriate for this use case. > > > > > > So for this you'd need a custom metaclass: > > I see, thanks! Now my problem is that I already have a custom > metaclass, defining a set of common attributes for ALL my classes.. > So, to declare additional fields for just a few classes, would it > be ok to subclass the custom metaclass again and re-call > declarative_base ()? > > To clarify: > All classes have a "timestamp" attribute, and a few of them has a > "notes" attribute too.
theoreticaly, u can make the metaclass look for some special attribute in the class' dict, say '_extra_stuff', and do whatever for them. then in each class define the '_extra_stuff' to be different. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---