On Sep 20, 2006, at 8:31 AM, Simen Haugen wrote:
I have a table with several fields that should default to NULL, but
are
having problems actually getting it to work.
I cannot set None in defaultValues:
Dabo Error Log: Wed Sep 20 13:54:42 2006: cannot create 'NoneType'
instances
Dabo Error Log: Wed Sep 20 13:54:42 2006: Failed to create newval for
field 'comment'
This actually also happens with without defaultValues. It will
guess the
type for some of the fields, but not all - setting some of them to
None.
I'm using textboxes to alter these values. Erasing the value from this
box doesn't set the value as NULL either.
How do I handle NULL values?
First, how are you setting the default values? I created a small
test table in the public MySQL webtest database on dabodev.com, with
a PK field and two varchar fields, one of which can accept null
values. I then created an AppWizard-generated app, and in the biz/
Testnull.py file, I changed the line:
self.DefaultValues = {}
to:
self.DefaultValues = {"canbenull": None,
"nonulls": "Bleh!"}
When I run the app and click the 'New' button, I get a new record
with a temp PK, '< None >' appearing in the 'canbenull' field, and
'Bleh!' in the 'nonulls' field. If you do the same thing, are you
getting nulls?
As far as editing goes, I don't know how to best handle that. Should
we make a rule that all nullable fields with blank values get stored
as null? Or perhaps a special keystroke to set the field to null?
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users