Hi,
just wondering is there could be a method to a Column object to know if
it's a Boolean column ?
I'm trying to retrieve a list of boolean columns from a table and I'm
doing the following:
from sqlalchemy.types import Boolean
for col in table.c.keys():
if isinstance(table.c[col].type, Boolean):
...
I have a similar test for PK columns. But the Column object provides a
way to test PK columns directly:
if table.c[col].primary_key:
...
Same for FK and nullable columns:
if table.c[col].foreign_key:
if table.c[col].nullable:
So I was wondering if there could be some convenient methods available
to test the type of a column ?
if table.c[col].is_bool:
if table.c[col].is_integer:
if table.c[col].is_string:
if table.c[col].is_date:
if table.c[col].is_time:
if table.c[col].is_datetime:
if table.c[col].is_binary:
I understand that dialect specific or custum types can't have their
methods here...
This is just some request from me to cultivate my lazyness.
Regards,
--
Alexandre CONRAD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---