mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
lower tags in python, as sqlite doesn't have full unicode tables
This commit is contained in:
parent
2944b8194b
commit
61fc7b4430
1 changed files with 4 additions and 6 deletions
10
anki/tags.py
10
anki/tags.py
|
@ -51,10 +51,8 @@ def tagIds(s, tags):
|
|||
ids = {}
|
||||
s.statements("insert or ignore into tags (tag) values (:tag)",
|
||||
[{'tag': t} for t in tags])
|
||||
tagsD = dict(s.all("""
|
||||
select lower(tag), id from tags
|
||||
tagsD = dict([(x.lower(), y) for (x, y) in s.all("""
|
||||
select tag, id from tags
|
||||
where tag in (%s)""" % ",".join([
|
||||
"'%s'" % t.replace("'", "''") for t in tags])))
|
||||
for tag in tags:
|
||||
ids[tag.lower()] = tagsD[tag.lower()]
|
||||
return ids
|
||||
"'%s'" % t.replace("'", "''") for t in tags]))])
|
||||
return tagsD
|
||||
|
|
Loading…
Reference in a new issue