On Nov 5, 2007, at 4:11 PM, Mike Orr wrote:
> > What's the simplest way to get the names of all columns containing > character data (VARCHAR or TEXT). I've got it down to this, which > works but is a bit obscure: > > def get_text_fields(table): > substrings = ["text", "string", "char"] > ret = [] > for c in table.columns: > name = c.type.__class__.__name__.lower() > for sub in substrings: > if sub in name: > ret.append(c.name) > break > return ret > > Regarding my earlier problem with foreign keys on autoload tables, > I've been getting inconsistent behavior in my app, so I need to test > it some more and verify whether there is a SQLAlchemy bug or stability > issue before I can report back. how about [c for c in table.c if isinstance(c.type, types.String)] ? --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---