*** When I submit, I get this error (nothing else printed):
Screenshot is here: http://gista.sk/dl/bugs/django/add_record_in_admin_submit.png
Mod_python error: "PythonHandler django.core.handlers.modpython"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line 222, in handler
return ModPythonHandler()(req)
File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line 195, in __call__
response = self.get_response(request)
File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line 128, in get_response
return self.handle_uncaught_exception(request, resolver, exc_info)
File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line 148, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/var/lib/python-support/python2.4/django/views/debug.py", line 39, in technical_500_response
html = reporter.get_traceback_html()
File "/var/lib/python-support/python2.4/django/views/debug.py", line 95, in get_traceback_html
c = Context({
File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 35, in smart_unicode
return force_unicode(s, encoding, strings_only, errors)
File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 70, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128). You passed in
*** Snippets from my model:
Full models.py is here: http://gista.sk/dl/bugs/django/models.py
class Metadata(models.Model):
vrstva = models.ForeignKey(Vrstva)
nazov = models.CharField(u"Názov stĺpca", max_length=100)
dlhy_nazov = models.CharField(u"Dlhý názov stĺpca", max_length=200)
hodnota = models.CharField(u"Formátovanie hodnoty", max_length=512, default="%s")
externa_databaza = models.ForeignKey(Externa_databaza, blank=True, null=True)
sql = models.TextField(u"SQL dopyt", blank=True)
def __unicode__(self):
return "%s %s" % (self.vrstva,self.nazov)
class Meta:
ordering = ["vrstva", "nazov"]
verbose_name_plural = u"metadata"
class Vrstva(Vrstvy_zaklad):
kategoria = models.ForeignKey(Kategoria, verbose_name=u"Kategória")
sql_atrib = models.TextField(u"Atributový SQL", blank=True)
tabulka = models.CharField(u"Tabuľka", max_length=200, blank=True, help_text=u"Tabuľka v ktorej sú gid a geom pre danú vrstvu")
transparent = models.BooleanField(u"Transparent")
zoom_level = models.IntegerField(u"Zoom level", default=1, help_text=u"Zoom level ktory sa použije pri zoomovaní na objekt pri vyhľadávaní")
sql_hladanie = models.TextField(u"Vyhľadávací SQL", blank=True)
class Meta:
ordering = ['kategoria','poradie']
verbose_name_plural = u"vrstvy"
*** My environment details:
OS: Debian Etch with python 2.4
Django version: 1.0, also tested on new 1.0.1 with same results
Database: PostgreSQL 8.1
*** It looks like the bug #3924 which should be allready closed.
Can anybody give me some hint where to look for the solution ?
Thanks a lot
--
Ivan
def __unicode__(self):
return "%s %s" % (self.vrstva,self.nazov)
def __unicode__(self):
return u"%s %s" % (self.vrstva,self.nazov)