Wednesday, January 4, 2012

Re: Admin interface does not save routine object

Oh, I think the problem is in the __unicode__() method of your Quiz8
model. You're returning self.document, which is a Document8 object and
not a unicode string. Try returning unicode(self.document) or something
like '%d' % document.id.

Brett


On 1/4/12 5:07 PM, "Andy Oram" <andyo@oreilly.com> wrote:

>Thanks, Bill. I apologize for not including DEBUG output. Here is what
>seems relevant. It looks like the ForeignKey relationship filled in
>fields
>with the id's of the document and document version (which is what
>one would expect) and there was a problem converting it to a string.
>
>----
>
>Request Method: POST
>Request URL: http://localhost:8000/admin/quiz9s/quiz9/add/
>Django Version: 1.3.1
>Exception Type: TypeError
>Exception Value:
>
>coercing to Unicode: need string or buffer, int found
>
>Exception Location: /usr/local/lib/python2.6/dist-packages/django/
>utils/encoding.py in force_unicode, line 71
>Python Executable: /usr/bin/python
>Python Version: 2.6.5
>
>-------
>
>csrfmiddlewaretoken: u'267144fccb830df5fa96feeb691b7ae8'
>
>document: u'1'
>
>quiz_owner: u'1'
>
>_save: u'Save'
>
>--
>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+unsubscribe@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate