#26679 closed Cleanup/optimization (fixed)
Document which methods are disabled on RelatedManager if there's an intermediate tables
Reported by: | Baptiste Mispelon | Owned by: | Ketan Bhatt |
---|---|---|---|
Component: | Documentation | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The note at https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.set says:
Also, if you are using an intermediate model for a many-to-many relationship, some of the related manager’s methods are disabled.
It would be helpful to know exactly which methods are disabled.
From what I understand, add
, create
, and remove
are disabled, but clear
works.
The linked documentation (https://docs.djangoproject.com/en/1.9/topics/db/models/#intermediary-manytomany) doesn't mention set
at all.
Change History (7)
comment:1 by , 8 years ago
Summary: | Improve reference documentation for RelatedManager and intermediate tables → Document which methods are disabled on RelatedManager if there's an intermediate tables |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
follow-up: 4 comment:3 by , 8 years ago
You're right, I was incorrect and set()
is indeed mentionned (turns out I was reading the 1.9 version of the docs instead of the latest).
To me, it would be helpful to have the list of disabled method explicitly listed (that's what I expect from a reference documentation).
I was thinking of something along the lines of "[...] some of the related manager's methods are disabled (add, create, and set)".
What do you think?
Thanks.
comment:4 by , 8 years ago
Replying to bmispelon:
You're right, I was incorrect and
set()
is indeed mentionned (turns out I was reading the 1.9 version of the docs instead of the latest).
To me, it would be helpful to have the list of disabled method explicitly listed (that's what I expect from a reference documentation).
I was thinking of something along the lines of "[...] some of the related manager's methods are disabled (add, create, and set)".
What do you think?
Take a look at https://github.com/django/django/pull/6677 and tell me if that looks good to you
Thanks.
It says [here](https://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany) that:
Should I link to this part of the documentation in the [note in Related objects reference](https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.set), or just state that only
clear()
can be used?