On 10/18/07, Rick Harding <[EMAIL PROTECTED]> wrote:
>
> Lukasz Szybalski wrote:
> > On 10/18/07, Rick Harding <[EMAIL PROTECTED]> wrote:
> >
> >> Paul Johnston wrote:
> >> Hi,
> >>
> >>
> >>
> >>
> >>>> Did you declare
> >>>> your table columns as Unicode?
> >>>>
> >>> I am auto leading the structure from the database.
> >>>
> >>>
> >> Ah, the problem is probably that the columns are reflecting as String, not
> >> Unicode.
> >>
> >> Tough one to fix! I'd probably hack the SA source code to reflect as
> >> Unicode. Another option is to use override the reflection, for the unicode
> >> columns.
> >>
> >>
> > How would I do that? Which function? Is there an option in SA to do it for
> > me?
> >
> >
> >> I had this issue and I ended up changing my model definitions to use
> >> unicode instead of string and then I added the extra param on the end of my
> >> dsn string ?use_unicode=1 I think it was.
> >>
> >> This solved the issue for me as the strings were taken care of straight
> >> away by sqlalchemy before they hit anything else.
> >>
> >> You might see if the dns flag helps when autoloading the structure as
> >> well.
> >>
> >>
> > What would this line look like then if I wanted to get the data as unicode?
> >
> > XXXname_table = sqlalchemy.Table('XXX', metadata, autoload=True)
> >
> > Lucas
> >
>
> Somewhere you define a connection string right? Where you define the
> server, db, username, password? That is the string you add the
> ?use_unitcode to.
You mean like this ?
sqlalchemy.dburi="mysql://user:[EMAIL PROTECTED]:3306/dbname?use_unitcode"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---