![]() |
How to define metaclass for a class that extends from sqlalc - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32) +---- Thread: How to define metaclass for a class that extends from sqlalc (/showthread.php?tid=27955) |
How to define metaclass for a class that extends from sqlalc - imperialguy - 07-02-2013 I use: Python 2.6 and sqlalchemy 0.6.1 This is what I am trying to do: Code: from sqlalchemy.types import ( And the error I am getting is this: Code: TypeError: Error when calling the metaclass bases Code: class Sample(object) instead of Code: class Sample(Base) it works absolutely fine. I need to update the attributes of the class dynamically. So, I will be using dynamic attribute and column names. And I need the above piece code to work in order to be able to get there. Please help[/code] |