Opened 10 years ago

Closed 10 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 Tim Graham, 10 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham, 10 years ago

Summary: Hide relationships with related_name='+'Hide relationships with related_name='+' in contrib.admindocs

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.

comment:3 by Claude Paroz, 10 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 gregchapple, 10 years ago

Owner: changed from nobody to gregchapple
Status: newassigned

comment:5 by gregchapple, 10 years ago

Keywords: nlsprint14 added

comment:6 by gregchapple, 10 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:7 by Baptiste Mispelon <bmispelon@…>, 10 years ago

In b1d10205ce0c4bb355e20bed6258b5264ed06cc5:

Added tests for django.contrib.admindocs

Refs #22015

comment:8 by Baptiste Mispelon, 10 years ago

Resolution: worksforme
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top