Hi Chris, The short answer is that I want to dynamically create classes/tables and I want to implement multiple inheritance (simplified version: just data and no overrides => no diamond problem), so I need some extra work like a extra tables for polymorphism. I think it would be most elegant to do this with metaclasses, but I am just experimenting until now. I will look at the mixin classes chapter though; I have some more challenges ... The long answer (when i get it to work) might come later.
Cheers, Lars On Mar 20, 8:33 pm, Chris Withers <ch...@simplistix.co.uk> wrote: > On 19/03/2011 10:27, farcat wrote: > > > OK, dumb error, move Base.metadata.create_all(engine) below table1 = > > tablemeta("table1") and it works. > > > This works when I create the columns via the temp dict in __new__ not > > when I do so in __init__ (it complains about missing __tabledata__), > > but why? > > I'd strongly suggest reading the section on Mixin classes rather than > doing stuff with Metaclasses: > > http://www.sqlalchemy.org/docs/orm/extensions/declarative.html?highli... > > If you *still* feel you need to use metaclasses after that, please let > us know why! ;-) > > Chris > > -- > Simplistix - Content Management, Batch Processing & Python Consulting > -http://www.simplistix.co.uk -- 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.