[Django] #28011: Correct Field.hidden docs regarding what fields are hidden

33 views
Skip to first unread message

Django

unread,
Apr 2, 2017, 9:02:54 PM4/2/17
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-----------------------------------------+------------------------
Reporter: Tim Graham | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The
[https://github.com/django/django/blob/d4d79d0f200357b28419203557cc61c8168316ab/docs/ref/models/fields.txt#L1912-L1918
Field.hidden] docs say, "Boolean flag that indicates if a field is used to
back another non-hidden field’s functionality (e.g. the content_type and
object_id fields that make up a GenericForeignKey)." This seems
inaccurate:
{{{#!python
from django.contrib.contenttypes.fields import GenericForeignKey,
GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models

class TaggedItem(models.Model):
tag = models.SlugField()
content_type = models.ForeignKey(ContentType,
on_delete=models.CASCADE, related_name='tagged_items')
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')

>>> TaggedItem._meta.get_field('object_id')
<django.db.models.fields.PositiveIntegerField: object_id>
>>> TaggedItem._meta.get_field('content_type')
<django.db.models.fields.related.ForeignKey: content_type>
}}}
(`object_id` and `content_type` aren't hidden).

There's a related discussion in the
[https://github.com/django/django/blob/d4d79d0f200357b28419203557cc61c8168316ab/docs/ref/models/meta.txt#L79-L84
Options.get_fields() docs] that also needs some correction.

Another thing I noticed is that `Field.hidden` is
[https://github.com/django/django/blob/d4d79d0f200357b28419203557cc61c8168316ab/django/db/models/options.py#L792-L793
only consulted for relational fields]. Removing `Field.hidden` and
`GenericForeignKey.hidden` doesn't result in any crash of `get_fields()`
because those attributes are never consulted.

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

Django

unread,
Apr 22, 2019, 5:28:02 AM4/22/19
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: cleopatra
| douglas
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by cleopatra douglas):

* owner: nobody => cleopatra douglas
* status: new => assigned


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

Django

unread,
Jan 4, 2021, 10:14:05 PM1/4/21
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Modestas
| Jakuska
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Modestas Jakuska):

* owner: nobody => Modestas Jakuska


* status: new => assigned

Django

unread,
Jan 5, 2021, 4:59:28 AM1/5/21
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)

Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Modestas Jakuska):

* owner: Modestas Jakuska => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/28011#comment:2>

Django

unread,
Apr 3, 2023, 6:00:25 AM4/3/23
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------+----------------------------------------
Reporter: Tim Graham | Owner: Akshat verma
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Akshat verma):

* owner: nobody => Akshat verma


* status: new => assigned


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

Django

unread,
Apr 3, 2023, 6:03:56 AM4/3/23
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------+----------------------------------------
Reporter: Tim Graham | Owner: Akshat verma
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------

Comment (by Mariusz Felisiak):

Akshat, are you going to work on any of these tickets? you've already
assigned many of them to yourself. I'd recommend to focus on a single one.

--
Ticket URL: <https://code.djangoproject.com/ticket/28011#comment:2>

Django

unread,
Feb 16, 2024, 5:04:48 PM2/16/24
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------+----------------------------------------
Reporter: Tim Graham | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Adam Johnson):

* has_patch: 0 => 1
* owner: nobody => Adam Johnson
* status: new => assigned

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

Django

unread,
Feb 17, 2024, 11:18:32 AM2/17/24
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin

Comment:

[https://github.com/django/django/pull/17861 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28011#comment:2>

Django

unread,
Feb 17, 2024, 1:22:18 PM2/17/24
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"7ba6c9edc50dc989fc5c306b541636249b952f93" 7ba6c9ed]:
{{{#!CommitTicketReference repository=""
revision="7ba6c9edc50dc989fc5c306b541636249b952f93"
Fixed #28011 -- Corrected Field.hidden docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28011#comment:3>

Django

unread,
Feb 17, 2024, 1:22:42 PM2/17/24
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"23c7cbfd241bb4287d042e8634a9c27ed3b7490e" 23c7cbf]:
{{{#!CommitTicketReference repository=""
revision="23c7cbfd241bb4287d042e8634a9c27ed3b7490e"
[5.0.x] Fixed #28011 -- Corrected Field.hidden docs.

Backport of 7ba6c9edc50dc989fc5c306b541636249b952f93 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28011#comment:4>

Django

unread,
Feb 19, 2024, 7:52:51 AM2/19/24
to django-...@googlegroups.com
#28011: Correct Field.hidden docs regarding what fields are hidden
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"f65f8ab84ebd2fc9772d23a159e6178e1335bd8b" f65f8ab]:
{{{#!CommitTicketReference repository=""
revision="f65f8ab84ebd2fc9772d23a159e6178e1335bd8b"
Refs #28011 -- Removed ForeignObjectRel.is_hidden().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28011#comment:5>
Reply all
Reply to author
Forward
0 new messages