On Wed, Jan 6, 2010 at 5:20 PM, rc <reedcr...@gmail.com> wrote:

> I get the following error when I try and delete a "testcase":
>
> Request Method: GET
> Request URL: http://hades/admin/bisite/testcase/20/delete/
> Django Version: 1.0.2 final
> Python Version: 2.5.2
> Installed Applications:
> [snip]
>
679.         get_deleted_objects(deleted_objects, perms_needed,
> request.user, obj, opts, 1, self.admin_site)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/util.py"
> in get_deleted_objects
>  107.                     nh(deleted_objects, current_depth, [u'%s:
> %s' % (force_unicode(capfirst(related.opts.verbose_name)), sub_obj),
> []])
>
> Exception Type: TypeError at /admin/bisite/testcase/20/delete/
> Exception Value: coercing to Unicode: need string or buffer, int found
>
> but deleting a "job" works just fine.
>
> You can see from my testcase model that it does in fact return a
> string (test_name)
>
>
Admin here is collecting a list of related objects that are going to need to
be deleted as a result of deleting the one you have chosen.  So not only
does Testcase need to have a proper unicode-returning __unicode__
implementation, so does any model that has a ForeignKey pointing to it.
Really, all your __unicode__ methods need to return unicode, not bytestrings
or ints or other objects.

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-us...@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