compare NFC

This commit is contained in:
j 2019-01-14 20:32:34 +05:30
commit 52f45beaec
4 changed files with 11 additions and 7 deletions

View file

@ -3,6 +3,7 @@
import json
import hashlib
import os
import unicodedata
from sqlalchemy.orm import load_only
from sqlalchemy.sql.expression import text
@ -211,6 +212,7 @@ def autocomplete(data):
qs = qs.filter(models.Find.item_id.in_(items))
if data['value']:
value = data['value'].lower()
value = unicodedata.normalize('NFKD', value)
qs = qs.filter(models.Find.key.is_(data['key']))
if op == '=':
qs = qs.filter(models.Find.findvalue.contains(value))