Opened 11 years ago
Closed 11 years ago
#22015 closed Bug (worksforme)
Hide relationships with related_name='+' in contrib.admindocs
Reported by: | motiejus | Owned by: | gregchapple |
---|---|---|---|
Component: | contrib.admindocs | Version: | dev |
Severity: | Normal | Keywords: | nlsprint14 |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | yes |
Description
If related_name of a ForeignKey/M2M relationship is '+', user explicitly asked Django to not create backwards relation. This should be taken into account when rendering admindocs.
Pull request: https://github.com/django/django/pull/2263
Change History (8)
comment:1 by , 11 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 11 years ago
Summary: | Hide relationships with related_name='+' → Hide relationships with related_name='+' in contrib.admindocs |
---|
comment:3 by , 11 years ago
Note that there are also tests in tests/admin_docs
, notably admin_docs.tests.AdminDocViewTests.test_model_detail
. We'd need a new models.py
, though.
comment:4 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 11 years ago
Keywords: | nlsprint14 added |
---|
comment:6 by , 11 years ago
Added tests which cover django.contrib.admindocs.views.ModelDetailView
which was seriously lacking in test coverage. This is part of ticket #22015, though the original issue for which the ticket was opened, seems to be already working as expected, with and without this patch. Though this patch does contain a test which covers the issue raised in the ticket, and should catch it in the future should it re-arise.
Pull request: https://github.com/django/django/pull/2364
I will do some further investigation into the original issue, and update again with my findings.
comment:8 by , 11 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
As mentionned by gregchapple, this appears to have already been fixed so I'll close this ticket as worksforme
.
Please reopen if you can provided steps that reproduce your issue.
Thanks.
As noted on the PR, admindocs is severely lacking in tests and bootstrapping them enough to be able to write a test for this change is more work than the reporter wants to do. If anyone else is interested in this patch, the first step will be to do that.