#20777: admin delete page proxy models
---------------------------------+--------------------------------------
Reporter: CollinAnderson | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.6-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by timo):
* stage: Unreviewed => Accepted
Comment:
I think the first solution makes the most sense. The model's
`__str__/__unicode__` method may refer to fields that aren't on the model
which would mean the second solution wouldn't work, right?
I'm getting a test failure with Python 3 with the first solution:
{{{
======================================================================
FAIL: test_delete_str_in_model_admin
(proxy_models.tests.ProxyModelAdminTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/django/tests/proxy_models/tests.py", line 406, in
test_delete_str_in_model_admin
self.assertEqual(delete_str, proxy_str)
AssertionError: 'Tracker user: <a
href="/admin/proxy_models/trackeruser/100/">TrackerUser:</a>' != 'Tracker
user: <a
href="/admin/proxy_models/trackeruser/100/">ProxyTrackerUser:Django
Pony</a>'
}}}
Changing `obj.__str__` to `obj.__unicode__` in the `if six.PY3` branch
fixes this. Possibly we should set `obj.__unicode__` regardless of Python
version and `obj.__str__` only for Python 3?
--
Ticket URL: <https://code.djangoproject.com/ticket/20777#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.d986fd3542f60bb96a450c127f47a652%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.