Currently, properties decorated with @cached_property are not included.
Please include them.
--
Ticket URL: <https://code.djangoproject.com/ticket/32421>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> From the documentation
> (https://docs.djangoproject.com/en/3.1/ref/contrib/admin/admindocs/):
> "The models section of the admindocs page describes each model in the
> system along with all the fields, properties, and methods available on
> it."
>
> Currently, properties decorated with @cached_property are not included.
> Please include them.
New description:
From the documentation
(https://docs.djangoproject.com/en/3.1/ref/contrib/admin/admindocs/): "The
models section of the admindocs page describes each model in the system
along with all the fields, properties, and methods available on it."
Currently, properties decorated with @cached_property are not included.
Please include them. And possibly include other (or all)
descriptors/attributes.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:1>
* version: 3.1 => master
* stage: Unreviewed => Accepted
Comment:
Agreed, we should include include cached properties (`@cached_property`).
I'm not sure about other descriptors and attributes, not all of them are
reasonable. I think we should end there.
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:2>
* owner: nobody => Ramon Saraiva
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:3>
Comment (by Ramon Saraiva):
How do you guys suggest the visualization of the `@cached_property` in the
fields table?
I thought about something like `{field_name} (cached property)` in the
field column.
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:4>
Comment (by Nat S Dunn):
Replying to [comment:4 Ramon Saraiva]:
I like the idea of indicating that it is a cached property using
`{field_name} (cached property)` in the field column, but currently there
is no distinction made for properties vs. fields, so if you were to do
that, it would make sense to do the same thing for standard properties -
`{field_name} (property)`, which would be helpful, but that may be out of
the scope of this issue. I'm not sure how that works. Thanks for taking
this on, by the way!
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:5>
Comment (by Ramon Saraiva):
Replying to [comment:5 Nat S Dunn]:
Would be straight forward to also add `{field_name} (property)` to
properties. Another way would be adding something to the `Description`
column.
> Replying to [comment:4 Ramon Saraiva]:
> I like the idea of indicating that it is a cached property using
`{field_name} (cached property)` in the field column, but currently there
is no distinction made for properties vs. fields, so if you were to do
that, it would make sense to do the same thing for standard properties -
`{field_name} (property)`, which would be helpful, but that may be out of
the scope of this issue. I'm not sure how that works. Thanks for taking
this on, by the way!
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:6>
Comment (by Nat S Dunn):
Replying to [comment:6 Ramon Saraiva]:
Cool. I'd prefer it in the Field column like in your original suggestion.
The Description column can get pretty busy.
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:7>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/13995 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"dcb094abe8cff505c4824532a8375f5edef407d5" dcb094ab]:
{{{
#!CommitTicketReference repository=""
revision="dcb094abe8cff505c4824532a8375f5edef407d5"
Fixed #32421 -- Made admindocs ModelDetailView show model cached
properties.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32421#comment:10>