| 1 | = Improvements to our data models |
| 2 | |
| 3 | Usually implemented in the `<subsystem>/model.py` files. |
| 4 | |
| 5 | In the current situation (1.0.x/1.1.1), we have different APIs and different conventions for the different models. We should try to be more consistent. |
| 6 | |
| 7 | == Representation of data |
| 8 | |
| 9 | === Standardize missing values |
| 10 | |
| 11 | For tickets, when a field is unset, we currently put the value back to the empty string. This was not always the case, as we used to reset it to `None` / `NULL` which is still what we do in some situations (retargeting tickets to no milestone after a milestone delete/close). See #7691 and #11018. |
| 12 | |
| 13 | We should standardize on `NULL` again. When retrieving `NULL` values from the database, we get `None` in Python. If needed, we can carry on this distinct meaning yet manipulate it as a string by converting `None` to 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]. |