[Django] #30706: Why isn't the auth.User.id field documented?

6 views
Skip to first unread message

Django

unread,
Aug 13, 2019, 10:10:08 PM8/13/19
to django-...@googlegroups.com
#30706: Why isn't the auth.User.id field documented?
-------------------------------------+-------------------------------------
Reporter: Conrad | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: 2.2
Documentation |
Severity: Normal | Keywords: auth Documentation
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I asked this at the GitHub project
([https://github.com/django/djangoproject.com/issues/934]) and was
redirected here: the default Django User id field exists and is used a lot
(as far as questions on Stack Overflow and example projects I can find
go), but I can't find any documentation on it apart from the fact, that it
is set "None" for Anonymous Users. @frankwiles told me on GitHub that the
reason might be that all models have the "id" field by default, but I
couldn't find a source that this is the reason why it isn't mentioned in
the docs.

I believe it is ok to use it, if not it should be added to the
documentation as a warning or similar text. If it is ok to use it, why not
write it down? It would help people like me (pretty new to Django) to
quickly find how to use unique user ids, maybe there are even some custom
settings most people don't know about.

--
Ticket URL: <https://code.djangoproject.com/ticket/30706>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 14, 2019, 1:52:14 AM8/14/19
to django-...@googlegroups.com
#30706: Why isn't the auth.User.id field documented?
-------------------------------------+-------------------------------------
Reporter: Conrad | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution: wontfix

Keywords: auth Documentation | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* version: 2.2 => master
* resolution: => wontfix


Comment:

Thanks for the report, however by default, each model has
[https://docs.djangoproject.com/en/2.2/topics/db/models/#automatic-
primary-key-fields automatic primary key field] `id` (if custom primary
key is not specified). I don't think that we need to add redundant `id`
description to the `User` model docs.

--
Ticket URL: <https://code.djangoproject.com/ticket/30706#comment:1>

Reply all
Reply to author
Forward
0 new messages