Am 13.11.2014 23:08, schrieb Ed Leafe:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/21/2014 01:05 PM, Sibylle Koczian wrote:
It seems that this should help:
filtered = [rec for rec in self if expr in ustr(rec[fld] or "")]
The problem is that some of the values are encoded, and others are not.
Try replacing the filter() method in db/dDataSet.py with the code here:
http://dabo.codepad.org/MCKfQJNK
That works as expected if the filter expression is a string (or unicode)
and the database column is any kind of text. It works, also, if I filter
a date column for dates before / after a fixed day. I don't yet trust
this filter method for numbers, wouldn't it compare them as strings,
with wrong results? As far as I can see ustr() converts numbers to
unicode, or doesn't it? I'll try it out, but I'll probably need some
days to write a reasonable test application.
I really wish we had more feedback from non-ASCII users when we were
writing this stuff! ;-)
Or an example database with enough non-ASCII stuff in it. I've found a
SQLite version of the Northwind database (but, sadly, can't remember
where, possibly on the companion CD to a book), quite usable for such
tests. Even without the "Frankfurter Grüne Soße" I added myself to the
products table.
Greetings,
Sibylle
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]