[PonyORM-list] Bug with filter() ?
alexander.kozlovsky at gmail.com
Tue Nov 17 08:44:46 UTC 2015
Hi Matthew! Thanks for the reporting!
I fixed the issue and pushed the fix to the GitHub. In order to make your
code work, you need to place the `u` prefix both before the string passed
to the filter() function and before the unicode literal inside the string:
models.Order.select().filter(u'u"ö" in o.user.email')
With the provided fix, this should work fine.
On Tue, Nov 17, 2015 at 1:39 AM, Matthew Bell <matthewrobertbell at gmail.com>
> A query like this works fine:
> models.Order.select().filter('"x" in o.user.email')
> However, using an accented character, I have difficulties:
> models.Order.select().filter('"ö" in o.user.email')
> ExprEvalError: '\xc3\xb6' in o.user.email raises NameError: name 'o' is
> not defined
> models.Order.select().filter(u'"ö" in o.user.email')
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in
> position 2: ordinal not in range(128)
> This happens in SQLite and postgres. Am I doing something wrong?
> Matthew Bell
> ponyorm-list mailing list
> ponyorm-list at ponyorm.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ponyorm-list