#31368 closed Cleanup/optimization (fixed)
Document Field.from_db_value()'s "expression" parameter.
| Reported by: | Paolo Lammens | Owned by: | Hasan Ramezani |
|---|---|---|---|
| Component: | Documentation | Version: | 3.0 |
| Severity: | Normal | Keywords: | documentation, missing |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
The documentation on the semantics and usage for the expression parameter in the `from_db_value` converter is nowhere to be found.
The only two places that mention this method are the Model field reference and the "Writing custom model fields" guide, but neither mention what expression is or how it should be used.
In fact, there is no specification for value or connection either, but at least the meaning of these parameters can be inferred.
Change History (7)
comment:1 by , 6 years ago
| Summary: | Missing documentation for `from_db_value` → Document from_db_value()'s "expression" parameter. |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 6 years ago
| Summary: | Document from_db_value()'s "expression" parameter. → Document Field.from_db_value()'s "expression" parameter. |
|---|
comment:3 by , 6 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:4 by , 6 years ago
comment:5 by , 6 years ago
| Easy pickings: | set |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
Django uses backend and field/expression converters.
expressionis a field or an expression and it's used by backend converters. All converters have the same signature that's why we keep theexpressionparameter inField.from_db_value()andExpression.convert_value()signatures even if for them it's the same asself.