When using the schema:
create table organization (
orgid SERIAL PRIMARY KEY,
org_long_name text default '',
is_orange bool NOT NULL DEFAULT false,
is_blue bool NOT NULL DEFAULT false,
create_timestamp timestamp DEFAULT now(),
with the code:
_fromDatabase = True
_idName = "orgid"
I found that although no columns are declared 'not null',
the SQLObject constructor insists that most columns are
(producing the error "did not get expected keyword
This is because although it correctly reads the
nullability from the database, it doesn't set the
default value 'None' into the columns it creates if
NULL is allowed for those columns.
Also, default values such as 'false' were not being
interpreted correctly, with the effect that not
specifying these values when creating an Organization
would set such columns to true.
The patch below fixes both of these bugs.