Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#7082 closed (invalid)

newforms Multivalue.clean() strange behavior

Reported by: leotr Owned by: nobody
Component: Forms Version: dev
Severity: Keywords: newforms multivaluefield clean
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi!
I have a question about newforms MultiValueField.clean() method:

for i, field in enumerate(self.fields):

try:

field_value = value[i]

except IndexError:

field_value = None

if self.required and field_value in EMPTY_VALUES:

#
# |
# Why here is self.required? What if i allow some fields in
# some cases to be empty? Is it a bug and 'field.required'
# should be instead of 'self.required'?
#

Regards,
Leo Trubach

Change History (3)

comment:1 by leotr, 16 years ago

Hi!
I have a question about newforms MultiValueField.clean() method:

        for i, field in enumerate(self.fields):
            try:
                field_value = value[i]
            except IndexError:
                field_value = None
            if self.required and field_value in EMPTY_VALUES:

#           ^
#           |
#           Why here is self.required? What if i allow some fields in
#           some cases to be empty? Is it a bug and 'field.required'
#           should be instead of 'self.required'?
#

Regards,
Leo Trubach

comment:2 by oyvind, 16 years ago

Resolution: invalid
Status: newclosed

comment:3 by Malcolm Tredinnick, 16 years ago

Support questions should be asked on the mailing list, not in Trac, please.

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