Opened 4 years ago

Closed 4 years ago

#19341 closed Bug (fixed)

inspectdb BooleanField instead of NullBooleanField where Null=True

Reported by: tim.bowden@… Owned by: nobody
Component: Core (Management commands) Version: 1.5-alpha-1
Severity: Normal Keywords: inspectdb BooleanField NullBooleanField
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Where db field is bool and null=True, inspectdb outputs:

<fieldname> = models.BooleanField(Null=True,...)

instead of models.NullBooleanField(Null=True,...)

Attachments (1)

19341-1.diff (3.5 KB) - added by Claude Paroz 4 years ago.
Detect NullBooleanField in inspectdb

Download all attachments as: .zip

Change History (4)

comment:1 Changed 4 years ago by Claude Paroz

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Changed 4 years ago by Claude Paroz

Attachment: 19341-1.diff added

Detect NullBooleanField in inspectdb

comment:2 Changed 4 years ago by Claude Paroz

Has patch: set

As often, tests harder than the fix :-)

comment:3 Changed 4 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 7bbd17bf20e46283954aead2750c24642fd8d9f9:

Fixed #19341 -- Detected NullBooleanField when introspecting models

Thanks Tim Bowden for the report.

Note: See TracTickets for help on using tickets.
Back to Top