Opened 4 years ago
Closed 4 years 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 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 3.1 → master |
comment:3 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
follow-up: 5 comment:4 by , 4 years ago
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.
follow-up: 6 comment:5 by , 4 years ago
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!
follow-up: 7 comment:6 by , 4 years ago
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.
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:7 by , 4 years ago
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 by , 4 years ago
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.