[Django] #23283: Provide an explicit default for BooleanField used in the documentation

6 views
Skip to first unread message

Django

unread,
Aug 13, 2014, 7:03:42 AM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
------------------------------------------------+------------------------
Reporter: bmispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
In Django 1.6, we changed the default value for a `BooleaField` from
`False` to `None`.
Having a `BooleanField` without a default now results in warnings when
running the `validate/check` command.

However, our documentation uses some `BooleaField` in a few examples (see
[1] for example) but they don't have a default value.

I propose that all usages of `BooleanField` in our documentation provide
an explicit default (`False` most likely) so that running the code doesn't
raise any warnings.

[1] https://docs.djangoproject.com/en/dev/topics/db/models/#multi-table-
inheritance

--
Ticket URL: <https://code.djangoproject.com/ticket/23283>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 13, 2014, 7:05:07 AM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
--------------------------------------+------------------------------------

Reporter: bmispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:1>

Django

unread,
Aug 13, 2014, 12:25:03 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by olasitarska):

* owner: nobody => olasitarska
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:2>

Django

unread,
Aug 13, 2014, 4:29:59 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by olasitarska):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:3>

Django

unread,
Aug 13, 2014, 4:52:43 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by collinanderson):

* stage: Accepted => Ready for checkin


Comment:

Feel free to link to the pull request
https://github.com/django/django/pull/3061. It looks good to me.

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:4>

Django

unread,
Aug 13, 2014, 6:22:28 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


Comment:

The PR looks good but I found more instances of `BooleanField` usage
(found with `git grep "BooleanField(" docs`):

* docs/ref/contrib/formtools/form-wizard.txt
* docs/ref/forms/validation.txt
* docs/topics/forms/index.txt

Would you mind fixing those too?
Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:5>

Django

unread,
Aug 13, 2014, 6:25:02 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"69478859261bd1b3e82cc785fddb5e50e3e7645f"]:
{{{
#!CommitTicketReference repository=""
revision="69478859261bd1b3e82cc785fddb5e50e3e7645f"
Fixed #23283 -- Added default=False to BooleanField's in the docs.

Thanks Baptiste for the suggestion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:6>

Django

unread,
Aug 13, 2014, 6:25:20 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0f44d9f9b153a25376e57060e849cddfaab9c350"]:
{{{
#!CommitTicketReference repository=""
revision="0f44d9f9b153a25376e57060e849cddfaab9c350"
[1.7.x] Fixed #23283 -- Added default=False to BooleanField's in the docs.

Thanks Baptiste for the suggestion.

Backport of 6947885926 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:7>

Django

unread,
Aug 13, 2014, 6:29:26 PM8/13/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* status: closed => new
* needs_better_patch: 1 => 0
* has_patch: 1 => 0
* resolution: fixed =>


Comment:

Oops, looks like I was a bit too slow on the review.

I still think we should fix the remaining 3 (see comment 5) so I'll reopen
this ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:8>

Django

unread,
Aug 14, 2014, 2:49:15 AM8/14/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by olasitarska):

* has_patch: 0 => 1


Comment:

I left them on purpose - these 3 remaining were in forms and I wasn't sure
if they're raising the same warnings :)

Here is a pull request with remaining three BooleanFields:
https://github.com/django/django/pull/3062

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:9>

Django

unread,
Aug 14, 2014, 3:31:26 AM8/14/14
to django-...@googlegroups.com
#23283: Provide an explicit default for BooleanField used in the documentation
-------------------------------------+-------------------------------------
Reporter: bmispelon | Owner:
Type: | olasitarska
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* status: new => closed
* resolution: => fixed


Comment:

You're absolutely right, my mistake.

Thanks again.

--
Ticket URL: <https://code.djangoproject.com/ticket/23283#comment:10>

Reply all
Reply to author
Forward
0 new messages