Hi,
using django automatic admin interface I need to show a select-box with
"True", "False" and "Unknown" values for a certain field of an object.
NullBooleanField is the natural choice as type of that field, but I
want to add a constraint and a default value in this way:
- default value should be "Unknown"
- "Unknown" value has not to be accepted as a valid value for that
field by the admin interface

The idea is to force the user to explicitly choose among Yes and No
without being able to skip that choice. Is there a better way to do it?

As far as I understand if I don't specify "default=<something>" the
default value is "Unknown" for NullBooleanField, as it is required. But
is it possible to say it explicitly in some way? default="Unknown" of
default=None don't work.

About the second point (avoiding "Unknown" value as an admin interface
constraint) I have no ideas.

Hints?

Thanks in advance,

Emanuele

Reply via email to