Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 Raúl Cumplido, 10 years ago

Owner: changed from nobody to Raúl Cumplido
Status: newassigned

comment:2 by Raúl Cumplido, 10 years ago

Cc: raulcumplido@… added

comment:3 by Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

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 default django.contrib.auth.models.User model without substituting your own model." I think "substituting your own model" means using AUTH_USER_MODEL.

comment:4 by Raúl Cumplido, 10 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 68d3db8a7b3dfe2690df3e7f750a5010086d6aa6:

Fixed #23725 -- Substituted AUTH_USER_MODEL for User in docs.

comment:6 by Tim Graham <timograham@…>, 10 years ago

In 9d1c5088bdd469e750e2f37caa392e0b956f80b2:

[1.7.x] Fixed #23725 -- Substituted AUTH_USER_MODEL for User in docs.

Backport of 68d3db8a7b from master

comment:7 by Tim Graham <timograham@…>, 10 years ago

In 10890606bc57afc38c5fbc7eb87dfcd35da524d6:

[1.6.x] Fixed #23725 -- Substituted AUTH_USER_MODEL for User in docs.

Backport of 68d3db8a7b from master

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