[Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-----------------------------------------+------------------------
               Reporter:  Ed Morley      |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Documentation  |        Version:  2.1
               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              |
-----------------------------------------+------------------------
 Hi!

 In Django 2.1, as part of adding `null` support to `BooleanField`, the
 previously implicit/hardcoded `blank=True` of `BooleanField` was removed:
 https://github.com/django/django/commit/5fa4f40f45fcdbb7e48489ed3039a314b5c961d0
 #diff-bf776a3b8e5dbfac2432015825ef8afeL995

 In one of our projects, we had a model with a `BooleanField` defined like
 so:

 {{{#!python
 class PerformanceAlert(models.Model):
     id = models.AutoField(primary_key=True)
     # ...
     is_regression = models.BooleanField()
 }}}

 The REST API for that model uses django-rest-framework's
 `ModelSerializer`, which generates validation rules based on the model
 properties.

 In Django 2.0, the d-r-f API serializer's `repr()` is:

 {{{#!python
 PerformanceAlertSerializer():
     id = IntegerField(read_only=True)
     # ...
     is_regression = BooleanField(required=False)
 }}}

 But under Django 2.1 this changed to

 {{{#!python
 PerformanceAlertSerializer():
     id = IntegerField(read_only=True)
     # ...
     is_regression = BooleanField()
 }}}


 As such under Django 2.1 API calls that were previously successful then
 failed with `This field is required.`. (It turned out our API is using
 `PUT`s in places it should really be using `PATCH`.)

 We were able to resolve the issue by adjusting
 `PerformanceAlertSerializer` such that it explicitly configures the field
 with `serializers.BooleanField(required=False)`, however it would be great
 to mention this ~breaking change in the Django 2.1 release notes (and also
 as a "changed in" on the `BooleanField` entry on the fields page) -
 particularly since it looks like several other people have hit the same
 issue:
 https://github.com/django/django/commit/5fa4f40f45fcdbb7e48489ed3039a314b5c961d0#r30206260
 https://code.djangoproject.com/ticket/29921

 If I get a chance I'll open a PR in the next few weeks, but happy for
 someone to beat me to it.

 Many thanks :-)

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/051.4e12fa51cd7ab72669d1a414351351cb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-------------------------------+----------------------------------------
     Reporter:  Ed Morley      |                    Owner:  Darius Azimi
         Type:  Uncategorized  |                   Status:  assigned
    Component:  Documentation  |                  Version:  2.1
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+----------------------------------------
Changes (by Darius Azimi):

 * owner:  nobody => Darius Azimi
 * status:  new => assigned


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.0453f1db41cc14956d1c5029b2d123fd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-------------------------------+--------------------------------------
     Reporter:  Ed Morley      |                    Owner:  (none)
         Type:  Uncategorized  |                   Status:  new
    Component:  Documentation  |                  Version:  2.1
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by Darius Azimi):

 * owner:  Darius Azimi => (none)
 * status:  assigned => new


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.8c657141aa4847bf94d0617b79b6b8a1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
--------------------------------------+------------------------------------
     Reporter:  Ed Morley             |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  2.1
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

 * type:  Uncategorized => Cleanup/optimization
 * easy:  1 => 0
 * stage:  Unreviewed => Accepted


Comment:

 I'm not sure what the note would say exactly. Is
 "`BooleanField.__init__()` no longer sets `blank=True`." enough? It
 doesn't seem to give much explanation about possible ramifications of the
 change and it's not Django's place to describe how django-rest-framework
 is affected. This behavior isn't documented in `ref/models/fields.txt`,
 and we normally don't include a versionchanged annotation for something
 that's undocumented.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.4fb858f83c206f319943d7afe2f157de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
--------------------------------------+------------------------------------
     Reporter:  Ed Morley             |                    Owner:  sejd0n
         Type:  Cleanup/optimization  |                   Status:  assigned
    Component:  Documentation         |                  Version:  2.1
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by sejd0n):

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


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.872c638b06cd779ad73cf04c53ea820a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-------------------------------------+-------------------------------------
     Reporter:  Ed Morley            |                    Owner:  David Vaz
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  2.1
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by David Vaz):

 * owner:  nobody => David Vaz
 * status:  new => assigned


Comment:

 submited a [https://github.com/django/django/pull/11826 PR]

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.b74ed247df1cabc1fc8bc4187e4e3de3%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-------------------------------------+-------------------------------------
     Reporter:  Ed Morley            |                    Owner:  David Vaz
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  2.1
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

 In [changeset:"a6972e88547ad5a51592f2b6d5046754c4b59394" a6972e88]:
 {{{
 #!CommitTicketReference repository=""
 revision="a6972e88547ad5a51592f2b6d5046754c4b59394"
 [2.2.x] Fixed #30216 -- Doc'd that BooleanField is no longer blank=True in
 Django 2.1.
 }}}

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.205aa3ba4f2ac00824cf0bcc775645b7%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-------------------------------------+-------------------------------------
     Reporter:  Ed Morley            |                    Owner:  David Vaz
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  2.1
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"1556a67c65c336ab12961c6123b129ac10e729b8" 1556a67c]:
 {{{
 #!CommitTicketReference repository=""
 revision="1556a67c65c336ab12961c6123b129ac10e729b8"
 [2.1.x] Fixed #30216 -- Doc'd that BooleanField is no longer blank=True in
 Django 2.1.

 Backport of a6972e88547ad5a51592f2b6d5046754c4b59394 from stable/2.2.x
 }}}

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.353b3ae19e9d4d43e52d0d27d8ccaa41%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30216: Document BooleanField is no longer blank=True in Django 2.1+

Django
In reply to this post by Django
#30216: Document BooleanField is no longer blank=True in Django 2.1+
-------------------------------------+-------------------------------------
     Reporter:  Ed Morley            |                    Owner:  David Vaz
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  2.1
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * has_patch:  0 => 1


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.910f39b9816d2a5752c8914b921f375f%40djangoproject.com.