Edgewall Software

Changes between Initial Version and Version 1 of TracDev/ScratchPad/DataModels


Ignore:
Timestamp:
Jan 25, 2013, 10:27:28 AM (11 years ago)
Author:
Christian Boos
Comment:

discuss the NULL/None vs. '' problem

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ScratchPad/DataModels

    v1 v1  
     1= Improvements to our data models
     2
     3Usually implemented in the `<subsystem>/model.py` files.
     4
     5In 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
     11For 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
     13We 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].