Probably stupid or already answered question here, sorry about that.
I know by definition a Boolean is supposed to have 2 values but I was wondering what is the good practice in Django to store a "third" None value let's say for optional Boolean fields.
So far I use a CharField or a ChoiceField with "yes", "no", "no_data" but I feel like it's not optimal. Is there a better way maybe using a special BooleanField that could store true/false/null or something like that?
You can use NullBooleanField for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With