Hello,
I have a custom type defined in my postgresql database, and this is
giving me the warning:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/sqlalchemy/engine/base.py:1265: SAWarning: Did not recognize
type 'fibertype' of column 'fiber_type'
self.dialect.reflecttable(conn, table, include_columns)
From an earlier email from Michael (13 September 2009), I saw that I
can do something like this:
sa_major_version = sqlalchemy.__version__[0:3]
if sa_major_version == "0.5":
from sqlalchemy.databases import postgres
postgres.ischema_names['fiber_type'] = fibertype
elif sa_major_version == "0.6":
from sqlalchemy.dialects.postgresql import base as pg
pg.ischema_names['fiber_type'] = fibertype
But of course "fibertype" needs to be defined. How can I define this?
The definition in the database is simply:
CREATE TYPE fibertype AS ENUM (
'A',
'B',
'C'
);
Cheers,
Demitri
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---