On Thu, Jul 16, 2009 at 4:59 AM, jfergon <jorge.fernandez.gonza...@gmail.com
> wrote:

>
> Hi,
>
> I'm working on Django-postgreSQL, and I can't solve a problem. This is
> my models.py:
>
> from django.db import models
> from datetime import datetime
>
> class Event(models.Model):
>    title = models.TextField(max_length=50,null=False)
>    celebration = models.DateField(default=datetime.now(),null=False)
>    num_proofs = models.IntegerField()
>    place = models.TextField(max_length=50,null=False)
>
> When I try to save the Event Object in views.py, I get the following
> error trace:
>
> Traceback (most recent call last):
>  File "/var/lib/python-support/python2.6/django/core/servers/
> basehttp.py", line 278, in run
>    self.result = application(self.environ, self.start_response)
>  File "/var/lib/python-support/python2.6/django/core/servers/
> basehttp.py", line 635, in __call__
>    return self.application(environ, start_response)
>  File "/var/lib/python-support/python2.6/django/core/handlers/
> wsgi.py", line 239, in __call__
>    response = self.get_response(request)
>  File "/var/lib/python-support/python2.6/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.6/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.6/django/views/debug.py", line
> 39, in technical_500_response
>    html = reporter.get_traceback_html()
>  File "/var/lib/python-support/python2.6/django/views/debug.py", line
> 97, in get_traceback_html
>    'exception_value': smart_unicode(self.exc_value,
> errors='replace'),
>  File "/var/lib/python-support/python2.6/django/utils/encoding.py",
> line 35, in smart_unicode
>    return force_unicode(s, encoding, strings_only, errors)
>  File "/var/lib/python-support/python2.6/django/utils/encoding.py",
> line 70, in force_unicode
>    raise DjangoUnicodeDecodeError(s, *e.args)
> DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in
> position 21: ordinal not in range(128). You passed in ProgrammingError
> ('no existe la columna \xc2\xabpeta\xc2\xbb en la relaci\xc3\xb3n
> \xc2\xabevent_event\xc2\xbb\nLINE 1: ...RT INTO
> "event_event" ("title", "celebration", "peta", "p...
> \n                                                             ^\n',)
> (<class 'psycopg2.ProgrammingError'>)
>
>
> Can somebody help me? Thank you so much.
>

There seems to be a couple of problems here.  First, whatever code is being
called to handle the url you have entered is causing a ProgrammingError with
a message:

no existe la columna «peta» en la relación «event_event»

which I gather is complaining that the table event_event does not have a
column named "peta".  As you don't have "peta" mentioned anywhere in your
Event model I am not sure why/where there is code apparently referencing it.

Django tries to generate a debug page to report this error, but runs into
trouble apparently because this ProgrammingError has a unicode method but
attempting to call that method generates a UnicodeDecode error.  (At any
rate that is the only way I can see, from a quick scan of the Django
force_unicode function, to get the result you are seeing.)  Having a unicode
method that generates an error like that would seem to be an error in
whatever code generates/implements this ProgrammingError -- but I don't know
what that code is and don't have time to dig into the issue right now.  I
don't believe the error is in Django -- I think it is in the database
adapter you are using.  So you might want to look into whether there have
been problems like this reported against that piece of code.

(If the error message gives you a clue what the problem is you might be able
to fix whatever is causing it and solve this particular problem, but I think
you will run into it again whenever you hit a database error that references
table or column names, given how the error message is quoting those values
with non-ASCII characters.)

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to