Closed RossBoylan closed 9 months ago
v0.0.7
deletes the message box in the accessor. Now the method just returns None
without raising an error.
There is still nothing to enforce that a date field must be non-missing. Clearly report_received_date
and report_returned_date
can be missing (None
in Python
, NULL
in the database) because many existing records have that.
However, all existing records have a real mri_date
(after I deleted the ones I created and a couple of clearly stray, blank records). This suggests mri_date
should be required.
Fixed in v0.1.0. Null dates are still allowed, but I leave that to #7. If null dates don't cause #7, they are kind of "OK".
This issue concerns current behavior and the design of how to handle such things, which doesn't work well.
User Experience
After hitting save when there is a missing date a cryptic box pops up
The title is a truncation of "bad date" and the body is the result of using
-
as a separator for empty month day and year. The program proceeds once you hit OK, and savesNULL
as the data.Consequences
NULL
dates, esp in themri_date
field, may be the cause of the problems noted in #7. There are 5418 records with nullreport_received_date
and 2467 with nullreport_returned_date
, but none with missingmri_date
. 11276 total records. So it seems safe to conclude that null values are OK for the first 2 fields.The user has no choice about whether to proceed, unless they never hit
OK
or terminate the program while it is waiting.Why is there was only 1 warning when there were 3 blank fields? 2 of the fields are in the
missing_fields
list and so are automaticNone
with going throughdate()
.Internals
isValid()
returns true forBSmallDateWidget
on a null date. Though I'm not sure I'm even calling the method right now.BSmallDateWidget.date()
, which is called bytodb()
, is where the action happens. If it can't convert to a valid date it usesQMessageBox.warning()
to pop up the annoying warning shown above. Then it returnsNone
. It traps all relevant errors, and raises no error on its own.BSmallDateWidget
has no ability to distinguish widgets that may be blank from others.Potentially related to error handling in general #4
Desired Behavior
mri_date
.