[Django] #21846: Admin's NestedObjects doesn't support related_name with %(app_label)s or %(class)s.

6 views
Skip to first unread message

Django

unread,
Jan 21, 2014, 12:24:03 PM1/21/14
to django-...@googlegroups.com
#21846: Admin's NestedObjects doesn't support related_name with %(app_label)s or
%(class)s.
-------------------------------+--------------------
Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
{{{
Traceback (most recent call last):
File "/Users/loic/Dev/django/tests/admin_util/tests.py", line 90, in
test_relation_on_abstract
n.collect([Contributor.objects.first()])
File "/Users/loic/Dev/django/django/contrib/admin/utils.py", line 176,
in collect
return super(NestedObjects, self).collect(objs,
source_attr=source_attr, **kwargs)
File "/Users/loic/Dev/django/django/db/models/deletion.py", line 199, in
collect
field.rel.on_delete(self, field, sub_objs, self.using)
File "/Users/loic/Dev/django/django/db/models/deletion.py", line 17, in
CASCADE
source_attr=field.name, nullable=field.null)
File "/Users/loic/Dev/django/django/contrib/admin/utils.py", line 176,
in collect
return super(NestedObjects, self).collect(objs,
source_attr=source_attr, **kwargs)
File "/Users/loic/Dev/django/django/db/models/deletion.py", line 187, in
collect
reverse_dependency=True)
File "/Users/loic/Dev/django/django/contrib/admin/utils.py", line 171,
in collect
self.add_edge(getattr(obj, related_name), obj)
AttributeError: 'Contributor' object has no attribute
'contributor_%(app_label)s_%(class)s'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21846>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 21, 2014, 12:34:13 PM1/21/14
to django-...@googlegroups.com
#21846: Admin's NestedObjects doesn't support related_name with %(app_label)s or
%(class)s.
-------------------------------+--------------------------------------

Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by loic84):

* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


Comment:

PR https://github.com/django/django/pull/2193

--
Ticket URL: <https://code.djangoproject.com/ticket/21846#comment:1>

Django

unread,
Jan 22, 2014, 2:55:34 AM1/22/14
to django-...@googlegroups.com
#21846: Admin's NestedObjects doesn't support related_name with %(app_label)s or
%(class)s.
-------------------------------------+-------------------------------------

Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by jeremb):

* stage: Unreviewed => Ready for checkin


Comment:

I can confirm this solves the problem I was having.

--
Ticket URL: <https://code.djangoproject.com/ticket/21846#comment:2>

Django

unread,
Jan 22, 2014, 10:13:42 AM1/22/14
to django-...@googlegroups.com
#21846: Admin's NestedObjects doesn't support related_name with %(app_label)s or
%(class)s.
-------------------------------------+-------------------------------------
Reporter: loic84 | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* status: new => closed
* resolution: => fixed


Comment:

Fixed in c3fdeb28fff35573bf86ef04b234c7f5817b0dea.

--
Ticket URL: <https://code.djangoproject.com/ticket/21846#comment:3>

Reply all
Reply to author
Forward
0 new messages