Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango headache with simple non-ascii string
    text
    copied!<p>I just created the following model:</p> <pre><code>class Categoria(models.Model): nombre=models.CharField(max_length=30) padre=models.ForeignKey('self', blank=True, null=True) def __unicode__(self): return self.nombre </code></pre> <p>Then registered to the admin interface and syncdb'd</p> <p>Everything ok if I just add plain ASCII chars. But if I add a "Categoria" named "á" (to say something) I get:</p> <pre><code>Environment: Request Method: GET Request URL: http://192.168.2.103:8000/administracion/locales/categoria/ Django Version: 1.1.1 Python Version: 2.6.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'cruzandoelsuquiaDJ.locales'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Template error: In template /usr/lib/pymodules/python2.6/django/contrib/admin/templates/admin/change_list.html, error at line 78 Caught an exception while rendering: ('ascii', '\xc3\xa1', 0, 1, 'ordinal not in range(128)') 68 : {% endif %} 69 : {% endblock %} 70 : 71 : &lt;form action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}&gt; 72 : {% if cl.formset %} 73 : {{ cl.formset.management_form }} 74 : {% endif %} 75 : 76 : {% block result_list %} 77 : {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %} 78 : {% result_list cl %} 79 : {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %} 80 : {% endblock %} 81 : {% block pagination %}{% pagination cl %}{% endblock %} 82 : &lt;/form&gt; 83 : &lt;/div&gt; 84 : &lt;/div&gt; 85 : {% endblock %} 86 : Traceback: File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/pymodules/python2.6/django/contrib/admin/options.py" in wrapper 226. return self.admin_site.admin_view(view)(*args, **kwargs) File "/usr/lib/pymodules/python2.6/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/lib/pymodules/python2.6/django/contrib/admin/sites.py" in inner 186. return view(request, *args, **kwargs) File "/usr/lib/pymodules/python2.6/django/contrib/admin/options.py" in changelist_view 986. ], context, context_instance=context_instance) File "/usr/lib/pymodules/python2.6/django/shortcuts/__init__.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/usr/lib/pymodules/python2.6/django/template/loader.py" in render_to_string 108. return t.render(context_instance) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 178. return self.nodelist.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render 97. return compiled_parent.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 178. return self.nodelist.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render 97. return compiled_parent.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 178. return self.nodelist.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render 24. result = self.nodelist.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render 24. result = self.nodelist.render(context) File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node 81. raise wrapped Exception Type: TemplateSyntaxError at /administracion/locales/categoria/ Exception Value: Caught an exception while rendering: ('ascii', '\xc3\xa1', 0, 1, 'ordinal not in range(128)') </code></pre> <p>My django version is 1.1 and my database is 5.1.37-1ubuntu5 with utf8 charset and the table is using a utf8_bin collation.</p> <p>This problem seems too basic to be true, and I'm a django newbie so I'm sorry in advance if I'm missing something very simple :)</p>
 

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