On Thu, Feb 3, 2011 at 4:55 PM, Richard Laager wrote:
> On Thu, 2011-02-03 at 13:46 -0500, Tobias McNulty wrote:
> > the behavior of all fields, except for BooleanField, is to default to
> > the empty value supported by that field.
> ...
> > On the other hand, False is in no way an "empty value."
On Thu, 2011-02-03 at 13:46 -0500, Tobias McNulty wrote:
> the behavior of all fields, except for BooleanField, is to default to
> the empty value supported by that field.
...
> On the other hand, False is in no way an "empty value."
From the point of view of the model layer, your point makes sen
On Thu, Feb 3, 2011 at 1:22 PM, anb wrote:
> On Feb 2, 3:08 pm, Chris Beaven wrote:
> > On Friday, January 21, 2011 12:35:58 PM UTC+13, Karen Tracey wrote:
> >
> > > Rather, a BooleanField that raises an error on an attempt to save an
> > > instance that has no value set is what's being asked fo
On Wed, Feb 2, 2011 at 6:08 PM, Chris Beaven wrote:
> On Friday, January 21, 2011 12:35:58 PM UTC+13, Karen Tracey wrote:
>>
>> Rather, a BooleanField that raises an error on an attempt to save an
>> instance that has no value set is what's being asked for. The quiet always
>> defaulting to False
On Feb 2, 3:08 pm, Chris Beaven wrote:
> On Friday, January 21, 2011 12:35:58 PM UTC+13, Karen Tracey wrote:
>
> > Rather, a BooleanField that raises an error on an attempt to save an
> > instance that has no value set is what's being asked for. The quiet always
> > defaulting to False does seem r
On Friday, January 21, 2011 12:35:58 PM UTC+13, Karen Tracey wrote:
>
> Rather, a BooleanField that raises an error on an attempt to save an
> instance that has no value set is what's being asked for. The quiet always
> defaulting to False does seem rather odd to me as well.
>
The current behavi
On Fri, Jan 21, 2011 at 7:35 AM, Karen Tracey wrote:
> On Thu, Jan 20, 2011 at 4:52 PM, Chris Beaven wrote:
>>
>> For good or bad, in Django a BooleanField is only ever supposed to be True
>> or False.
>> A default of False seems the logical equivalent to the default of '' on a
>> not-null CharFi
> Does removing it cause any test failures?
>
> Karen
Yes, one, on sqlite:
Test:
ERROR: test_issue_6755
(regressiontests.model_inheritance_regress.tests.ModelInheritanceTest)
Exception:
IntegrityError: model_inheritance_regress_restaurant.serves_hot_dogs
may not be NULL
This is the desired beha
On Thu, Jan 20, 2011 at 4:52 PM, Chris Beaven wrote:
> For good or bad, in Django a BooleanField is only ever supposed to be True
> or False.
> A default of False seems the logical equivalent to the default of '' on a
> not-null CharField.
>
> If you want a nullable boolean, you should use the se
For good or bad, in Django a BooleanField is only ever supposed to be True
or False.
A default of False seems the logical equivalent to the default of '' on a
not-null CharField.
If you want a nullable boolean, you should use the separate
NullBooleanField.
--
You received this message because
This seems right to me. Does anyone with more history on BooleanField
know of any reason why the "wontfix" resolution on #2855 was incorrect
and the current default-to-False behavior is correct?
Carl
--
You received this message because you are subscribed to the Google Groups
"Django developers
Models with a BooleanField are instantiated with that field's value
set to False if no default or initial value is provided. Instead, like
most other fields, the field's initial value should be set to None.
This None should be left uncoerced when attempting to save the
instance, so attempting to sa
12 matches
Mail list logo