[PonyORM-list] Inheritence

Matthew Bell matthewrobertbell at gmail.com
Mon Jul 7 22:48:35 UTC 2014


I have a project where it is intuitive to model the data by creating a
bunch of models which all inherit from a base model, and share a lot of the
same attributes (they'd be storing results of very similar processes).

Here is how I tried to attempt it:


This fails, because "DBSchemaError: Column 'y' already exists in table

I can do it like this:


It works, but quickly becomes messy when I have many attributes (up to
around 30 would be needed), as there would be many useless classes, and
inheriting from say 10 classes at once does not seem clear to me, compared
to just defining repeated attributes. Is there a way I can make the former
example work, or am I missing an alternative technique to get the same
result? It seems advantageous to inherit from a base, so that it is easy to
search all data by issuing queries on only one table.



Matthew Bell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20140708/5d9289dd/attachment.html>

More information about the ponyorm-list mailing list