Opened 2 months ago
Closed 2 months ago
#32421 closed New feature (fixed)
Add @cached_property in admindocs
Reported by: | Nat S Dunn | Owned by: | Ramon Saraiva |
---|---|---|---|
Component: | contrib.admindocs | Version: | dev |
Severity: | Normal | Keywords: | cached_property |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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.
Change History (10)
comment:1 Changed 2 months ago by
Description: | modified (diff) |
---|
comment:2 Changed 2 months ago by
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 3.1 → master |
comment:3 Changed 2 months ago by
Owner: | changed from nobody to Ramon Saraiva |
---|---|
Status: | new → assigned |
comment:4 follow-up: 5 Changed 2 months ago by
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.
comment:5 follow-up: 6 Changed 2 months ago by
Replying to 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!
comment:6 follow-up: 7 Changed 2 months ago by
Replying to 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.
comment:7 Changed 2 months ago by
Replying to Ramon Saraiva:
Cool. I'd prefer it in the Fields
column like in your original suggestion. The Description
column can get pretty busy.
comment:9 Changed 2 months ago by
Triage Stage: | Accepted → Ready for checkin |
---|
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.