Opened 16 years ago
Closed 14 years ago
#10786 closed Cleanup/optimization (fixed)
Missing Documentation for new BooleanField limitation
Reported by: | robingreen | Owned by: | sbj3 |
---|---|---|---|
Component: | Core (Other) | Version: | 1.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The recent add to django/trunk/django/core/management/validation.py breaks the Rietveld install process as described in:
Attachments (1)
Change History (9)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
$ make all svn co http://rietveld.googlecode.com/svn/trunk/codereview@405 A codereview/intra_region_diff.py A codereview/middleware.py A codereview/patching.py A codereview/views.py A codereview/__init__.py A codereview/models.py A codereview/library.py A codereview/engine.py A codereview/urls.py A codereview/feeds.py U codereview Checked out revision 405. patch -p0 < patches/library.diff patching file codereview/library.py patch -p0 < patches/views.diff patching file codereview/views.py patch -p0 < patches/models.diff patching file codereview/models.py ./manage.py syncdb Error: One or more models did not validate: codereview.issue: "local_base": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.issue: "closed": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.message: "draft": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.content: "is_uploaded": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.content: "is_bad": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.content: "file_too_large": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.patch: "is_binary": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.patch: "delta_calculated": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.comment: "left": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.account: "fresh": BooleanFields do not accept null values. Use a NullBooleanField instead. codereview.account: "uploadpy_hint": BooleanFields do not accept null values. Use a NullBooleanField instead. make: *** [dev.db] Error 1
comment:3 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
The error message makes clear what's going on here. BooleanField
is only for two-value (true or false) logic. If three-value (true, false or null) logic is needed, use NullBooleanField
.
[10456] corrected a bug wherein null=True
was allowed on the field definition even though assigning a null value to the field would raise a (run-time) exception. The correct thing for any application which relied on the buggy behavior is simply to use a NullBooleanField
instead.
comment:4 by , 15 years ago
Needs documentation: | set |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
Summary: | "BooleanFields do not accept null values" breaks Rietveld local install. → Missing Documentation for new BooleanField limitation |
I am reopening - apologies if this is not the proper way to do this. This change is not documented in the Model field documentation nor in the backwards incompatible changes list (e.g., in the release notes or in the Wiki).
See in particular the (now) misleading text in:
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.null
And no mention of this limitation in:
http://docs.djangoproject.com/en/dev/ref/models/fields/#booleanfield
comment:5 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
This should be in the 1.1 release document.
by , 15 years ago
Attachment: | fields-10786.diff added |
---|
Added note to null attribute and BooleanField that NullBooleanField s/b used.
comment:6 by , 15 years ago
Has patch: | set |
---|---|
Needs documentation: | unset |
Owner: | changed from | to
Status: | reopened → new |
comment:7 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Cleanup/optimization |
Here's the error's output:
$ make all
svn co http://rietveld.googlecode.com/svn/trunk/codereview@405
A codereview/intra_region_diff.py
A codereview/middleware.py
A codereview/patching.py
A codereview/views.py
A codereview/init.py
A codereview/models.py
A codereview/library.py
A codereview/engine.py
A codereview/urls.py
A codereview/feeds.py
Checked out revision 405.
patch -p0 < patches/library.diff
patching file codereview/library.py
patch -p0 < patches/views.diff
patching file codereview/views.py
patch -p0 < patches/models.diff
patching file codereview/models.py
./manage.py syncdb
Error: One or more models did not validate:
codereview.issue: "local_base": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.issue: "closed": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.message: "draft": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.content: "is_uploaded": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.content: "is_bad": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.content: "file_too_large": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.patch: "is_binary": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.patch: "delta_calculated": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.comment: "left": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.account: "fresh": BooleanFields do not accept null values. Use a NullBooleanField instead.
codereview.account: "uploadpy_hint": BooleanFields do not accept null values. Use a NullBooleanField instead.
make: * [dev.db] Error 1