Edgewall Software

Changes between Version 6 and Version 7 of TracDev/ScratchPad/DataModels


Ignore:
Timestamp:
Apr 16, 2018, 11:11:50 AM (18 months ago)
Author:
Ryan J Ollos
Comment:

Document behavior dicussed in comment:18:ticket:12029.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ScratchPad/DataModels

    v6 v7  
    99=== Standardize missing values
    1010
    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.
     11For 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
     15The pattern could be extended to other model classes, and even the `Ticket` model should be reviewed to ensure that all fields follow the pattern.
    1216
    1317=== `NOT NULL` columns