#23725 closed Cleanup/optimization (fixed)
Inconsistent documentation about ForeignKey(User)
Reported by: | Raúl Cumplido | Owned by: | Raúl Cumplido |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | raulcumplido@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
In the documentation when we are saying to reference to the User model we say (https://github.com/django/django/blob/master/docs/topics/auth/customizing.txt#L429):
Code highlighting:
When you define a foreign key or many-to-many relations to the User model, you should specify the custom model using the :setting:`AUTH_USER_MODEL` setting.
We also recommend to use it in troubleshooting here (https://github.com/django/django/blob/master/docs/ref/applications.txt#L402)
But in other parts of the documentation we are still referring and having examples to do it from the User model on django.contrib.auth.models directly (https://github.com/django/django/blob/master/docs/ref/models/fields.txt#L1264, https://github.com/django/django/blob/master/docs/topics/auth/customizing.txt#L311):
Code highlighting:
from django.contrib.auth.models import User
Shouldn't it be good to have consistency and to remove the later examples to match the ones we recommend?
Change History (7)
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
Cc: | added |
---|
comment:3 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 10 years ago
Has patch: | set |
---|
pull request: https://github.com/django/django/pull/3443
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I think the first place in fields.txt could be updated, but the second place seems to be explicitly talking about not using
AUTH_USER_MODEL
: "There are two ways to extend the defaultdjango.contrib.auth.models.User
model without substituting your own model." I think "substituting your own model" means usingAUTH_USER_MODEL
.