Lee McFadden wrote:
> Going from the line number in your exception that would be because
> your columns are of type String. Change the columns to Unicode and it
> should solve your problem.
>
> foo_table = Table('foo', metadata,
> Column('id', Integer, primary_key=True),
> Column('bar', Unicode(255))
> )
>
In case you're using reflection:
Overriding Reflected Columns
Individual columns can be overridden with explicit values when
reflecting tables; this is handy for specifying custom datatypes,
constraints such as primary keys that may not be configured within the
database, etc.
>>> mytable = Table('mytable', meta,
... Column('id', Integer, primary_key=True), # override reflected 'id' to
have primary key
... Column('mydata', Unicode(50)), # override reflected 'mydata' to be
Unicode
... autoload=True)
<http://www.sqlalchemy.org/docs/metadata.myt#metadata>
or use convert_unicode=True in create_engine, as I do, it should help.
In my case, I have UTF8 as default encoding for postgres, and SA
reflects columns as PGString.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---