Portál AbcLinuxu, 17. května 2024 12:20
SELECT * FROM WHERE to_ascii(encode(convert_to(myapp_article.body, 'latin2'),'escape'),'latin2') ILIKE '%konicek%'ja to skusam takto, ale dnes asi nie je moj den:)
Article.objects.extra(where=["to_ascii(encode(convert_to(myapp_article.body, 'latin2'),'escape'),'latin2') ILIKE %s"],params=['%konicek%'])hodi to chybovu hlasku:
Traceback (most recent call last): File "console", line 1, in ? File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/db/models/query.py", line 102, in __repr__ return repr(self._get_data()) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/db/models/query.py", line 470, in _get_data self._result_cache = list(self.iterator()) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/db/models/query.py", line 183, in iterator cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/db/backends/util.py", line 12, in execute return self.cursor.execute(sql, params) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/db/backends/postgresql/base.py", line 43, in execute return self.cursor.execute(sql, [smart_basestring(p, self.charset) for p in params]) ProgrammingError: ERROR: current transaction is aborted, commands ignored until end of transaction blockmimochodom, funkciu som nasiel tu este som sa chcel spytat, podla informacii fulltextove hladanie neignoruje diakritiku, takze by to tento problem nevyriesilo, alebo ano? este raz diky
Tiskni Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.