Opened 5 years ago
Closed 5 years ago
#30706 closed Cleanup/optimization (wontfix)
Why isn't the auth.User.id field documented?
Reported by: | Conrad | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | auth Documentation |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (1)
comment:1 by , 5 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Version: | 2.2 → master |
Thanks for the report, however by default, each model has automatic primary key field
id
(if custom primary key is not specified). I don't think that we need to add redundantid
description to theUser
model docs.