PacSci wrote: > Hi. > After working out my metadata issues (and scrapping four revisions and > a Tomboy notepad of plans for my framework), I've realized that I am > going to need something that is like FormAlchemy, but will convert > models to a WTForms form instead. I've got the basis of the form field > extraction code from the wtforms.ext.django.orm module, but what I > need is a way to check the type of a column from the column instance. > I'm having trouble tracing where the type is registered since > everything inherits from three or four other classes, so is there a > method or attribute of Column that contains the type provided? > > Regards again, > Leaf
The "type" attribute (col.type) is all I'm aware of. I would study the types module (sqlalchemy.types), since col.type will subclass one of those base types. Also, col.type.get_col_spec() may be of interest. An example of a Postgresql text typed column, where t is the table def. >>> t.c.name.type PGText(length=None, convert_unicode=False, assert_unicode=None) >>> t.c.name.type.get_col_spec() 'TEXT' --Randall --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---