>> PostgreSQL inet type seems not to be a supported type at the >> moment. Are >> there plans to add it in SA? > >I dont think INET is a SQL type, so the PGInet type would be its own >object in postgres.py, subclassing TypeEngine directly. it would >also need to define what kind of python object should be sent/ >received in the convert_bind_param/convert_result_value methods >(unless psycopg2 is doing that for us).
Psycopg2 returns a string, not a particular type. My application is an editor of db tables, that autoloads tables. Of course every time an unknown type is met it raises a bad error. How do you consider it's better to cope with this situation? In particular this inet type is written by Django in the comments_(free)comments table, so no way to autoload that table. In my version Patching my personal copy is not handy, and postgesql.py doesn't support other Postgres types as well (eg: arrays, geometric, network, bit). What's your view on how should one deal with these types? >> A laste question. How (if at all) can I use get_dbapi_type to know >> the type >> of a returned data after autoloading a Table but *before* issueing >> a query? >> (to know wich widget should handle it). > >if you are looking for the python type (which is distinct from a >DBAPI type), we dont have that mapping set up right now (though there >is an old ticket in trac for this). id propose adding a >"get_python_type" method to TypeEngine. although if you are already +1 for this. That'd be definitely usefull also to cast back from widgets to correct type. >mapping widgets to types, you could map to the TypeEngine classes >directly as well for now.... I'm a little confused. table.c[attr_name].type would return something like this: <sqlalchemy.databases.postgres.PGInt object at 0xb6d5b92c> How can I get: <sqlalchemy.types.Integer> Thanks sandro *:-) -- Sandro Dentella *:-) http://www.tksql.org TkSQL Home page - My GPL work --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---