Opened 17 years ago

Closed 16 years ago

Last modified 13 years ago

#7244 closed (fixed)

ModelChoicesField.__init__ and ModelMultipleChoicesField.__init__ must not pass a widget to the parent __init__.

Reported by: Sebastian Noack Owned by: Adrian Holovaty
Component: Forms Version: dev
Severity: Keywords: aug22sprint
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ramiro Morales)

There is a bug in the ModelChoicesField and ModelMultipleChoicesField from django.newforms.models, which passed Select or MultipleSelect as default widget to the parent __init__ if not specified. This breaks the ability to set the widget class attribute in derived classes. I wrote a patch, that fixes this.

Attachments (3)

0001-Fixed-widget-handling-in-ModelChoicesField.__init__.patch (2.5 KB ) - added by Sebastian Noack 17 years ago.
0001-Fixed-widget-handling-in-ModelChoicesField.__init__.2.patch (2.2 KB ) - added by Sebastian Noack 17 years ago.
7244.patch (1.9 KB ) - added by Collin Grady 16 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Sebastian Noack, 17 years ago

Cc: Adrian Holovaty added

comment:2 by Sebastian Noack, 17 years ago

Cc: Adrian Holovaty removed
Owner: changed from nobody to Adrian Holovaty

comment:4 by Ramiro Morales, 16 years ago

Description: modified (diff)

comment:5 by Eric Holscher, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

by Collin Grady, 16 years ago

Attachment: 7244.patch added

comment:6 by Collin Grady, 16 years ago

Keywords: aug22sprint added

FilePathField did the same thing - updated patch, fields still work, tests still pass

comment:7 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [8489]) Fixed #7244 -- Allow widget overriding in subclasses for ModelChoiceField,
ModelMultipleChoiceField and FilePathField. Patch from Sebastian Noack and
Colin Grady.

comment:8 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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