Considering this code (and using SQLAlchemy 0.7.7):
class Document(Base):
__tablename__ = \'document\'
__table_args__ = {
\'schema\': \'app\'
You can explore the base classes...
def find_type(class_, colname):
if hasattr(class_, '__table__') and colname in class_.__table__.c:
return class_.__table__.c[colname].type
for base in class_.__bases__:
return find_type(base, colname)
raise NameError(colname)
print find_type(Arrete, 'date_arrete')
print find_type(Arrete, 'date')