Opened 17 years ago

Closed 17 years ago

#3131 closed defect (duplicate)

[patch] MultipleChoiceFields fail to validate for newforms

Reported by: ben <ben.dean.kawamura@…> Owned by: Adrian Holovaty
Component: Forms Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Validation fails when using the SelectMultiple widgets (the default) because value_from_datadict always returns a single value instead of a list.

Attachments (1)

select-multiple.diff (579 bytes ) - added by ben <ben.dean.kawamura@…> 17 years ago.
patch

Download all attachments as: .zip

Change History (5)

by ben <ben.dean.kawamura@…>, 17 years ago

Attachment: select-multiple.diff added

patch

comment:1 by Massimiliano Ravelli, 17 years ago

Summary: MultipleChoiceFields fail to validate for newforms[patch] MultipleChoiceFields fail to validate for newforms

Ben explained the defect much better than me (#3129).

In that ticket there's a little patch with a couple of tests.

I'm going to close #3129 and attach here the tests. What do you think about that ?

I changed the title to make evident there is a patch with Ben's solution.

comment:2 by fy@…, 17 years ago

I confirm this, had same problem with MultipleChoiceField, patch fixes it.

comment:3 by Massimiliano Ravelli <massimiliano.ravelli@…>, 17 years ago

Hi Ben, I tested your patch !
It works with QueryDict and MultiValueDict but doesn't work with normal dict.
A couple of regression test is failing.

In #3114 there is a patch that fixes the problem and passes all tests.
It passes the tests attached in #3129 too.

I suggest you to close this one as duplicate of #3114.

comment:4 by Adrian Holovaty, 17 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #3114, which has been fixed.

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