11 | | For tickets, when a field is unset the database value is set to `None` / `NULL` (#11018). When retrieving `NULL` values from the database, we get `None` in Python, and the empty string is returned from the model using the special value [apidoc:api/trac_util_text#trac.util.text.empty empty]. See e.g. what we do for [source:trunk/trac/ticket/model.py@11111:127,137#L110 ticket fields]. The pattern could be extended to other model classes, and even the `Ticket` model should be reviewed to ensure that all fields follow the pattern. |
| 11 | For tickets, when a field is unset the database value is set to `None` / `NULL` (#11018). When retrieving `NULL` values from the database, we get `None` in Python, and the value returned from the model depends on the field type: |
| 12 | * For text fields, the empty string is returned from the model using the special value [apidoc:api/trac_util_text#trac.util.text.empty empty]. See e.g. what we do for [source:trunk/trac/ticket/model.py@11111:127,137#L110 ticket fields]. |
| 13 | * For time fields, `None` is returned. |
| 14 | |
| 15 | The pattern could be extended to other model classes, and even the `Ticket` model should be reviewed to ensure that all fields follow the pattern. |