Note that there are some explanatory texts on larger screens.

plurals
  1. POUnicodeDecodeError in smart_select in JSON QuerySet
    text
    copied!<p>I'm using <a href="https://github.com/digi604/django-smart-selects" rel="nofollow">Smart Select</a> to join two models using a another one. But when <code>smart_select</code> builds the filter, I get an error 500. When put the server in Debug mode I can see the Exception Type</p> <pre><code>Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 115. response = callback(request, *callback_args, **callback_kwargs) File "/opt/cmi/cmi/smart_selects/views.py" in filterchain 21. results.sort(cmp=locale.strcoll, key=lambda x: unicode_sorter(unicode(x))) File "/opt/cmi/cmi/smart_selects/views.py" in &lt;lambda&gt; 21. results.sort(cmp=locale.strcoll, key=lambda x: unicode_sorter(unicode(x))) Exception Type: UnicodeDecodeError at /chaining/filter/rechazos/Causa/conjunto/1/ Exception Value: 'ascii' codec can't decode byte 0xc3 in position 29: ordinal not in range(128) </code></pre> <p>The desired output is like this:</p> <pre><code>[{"display": "A - DOC sin huella(s) en el \u00e1rea de solicitud", "value": 1}, {"display": "B1 - DOC sin firma en el \u00e1rea de solicitud", "value": 2}, {"display": "M1 - Documento roto y/o manchado", "value": 7}, {"display": "O - Faltante f\u00edsico detectado en el paquete DOC", "value": 8}, {"display": "O2 - Faltante f\u00edsico detectado en el paquete DOC", "value": 5} </code></pre> <p>I my windows 8, with the same code and same data, I'm unable to reproduce this error.</p> <p>Relevants parts of the app can be viewed here: <a href="https://gist.github.com/jstoledano/6083353" rel="nofollow">https://gist.github.com/jstoledano/6083353</a></p> <ul> <li>OS: Ubuntu 12.04</li> <li>Python: 2.7.3</li> <li>MySQL: Ver 14.14 Distrib 5.5.31 <ul> <li>Character Set: UTF-8</li> <li>Collation: utf8_bin</li> </ul></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload