Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#24674 closed Bug (fixed)

NullBooleanField in a model is converted to NullBooleanField in a form, not CharField

Reported by: Marten Kenbeek Owned by: Simon Charette
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The documentation[1] states that a NullBooleanField on a model is converted to a CharField when using a ModelForm. It is actually converted to a NullBooleanField [2].

[1] https://docs.djangoproject.com/en/1.8/topics/forms/modelforms/#field-types
[2] https://github.com/django/django/blob/stable/1.8.x/django/db/models/fields/__init__.py#L2080

Change History (5)

comment:1 by Simon Charette, 10 years ago

Triage Stage: UnreviewedAccepted
Version: 1.8master

comment:2 by Simon Charette, 10 years ago

Owner: changed from nobody to Simon Charette
Status: newassigned

comment:3 by Simon Charette <charette.s@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 37e23c60:

Fixed #24674 -- Documented the correct NullBooleanField formfield.

Thanks to knbk for the report.

comment:4 by Simon Charette <charette.s@…>, 10 years ago

In beb9570:

[1.8.x] Fixed #24674 -- Documented the correct NullBooleanField formfield.

Thanks to knbk for the report.

Backport of 37e23c606031d5b34197e196fb6e6fed0137bb37 from master

comment:5 by Simon Charette <charette.s@…>, 10 years ago

In a297af9:

[1.7.x] Fixed #24674 -- Documented the correct NullBooleanField formfield.

Thanks to knbk for the report.

Backport of 37e23c606031d5b34197e196fb6e6fed0137bb37 from master

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