I'm using Smart Select to join two models using a another one. But when smart_select
builds the filter, I get an error 500. When put the server in Debug mode I can see the Exception Type
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 <lambda>
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)
The desired output is like this:
[{"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}
I my windows 8, with the same code and same data, I'm unable to reproduce this error.
Relevants parts of the app can be viewed here: https://gist.github.com/jstoledano/6083353
- OS: Ubuntu 12.04
- Python: 2.7.3
- MySQL: Ver 14.14 Distrib 5.5.31
- Character Set: UTF-8
- Collation: utf8_bin