newforms: [] not in EMPTY_VALUES

14 visningar
Hoppa till det första olästa meddelandet

webograph

oläst,
13 apr. 2007 15:03:002007-04-13
till django-d...@googlegroups.com
hi,

i noticed that [] is not in the EMPTY_VALUES against which data is
validated in newforms fields' default clean() function; this makes
fields which usually return lists raise the ValidationError 'This field
is required.' themselves instead of relying on super(). an example of
this behavior is the MultipleChoiceField (newforms/fields.py:376).

is this intended behavior or just a leftover from some earlier stage?
why isn't the boolen representation used instead? (`if self.required and
not value:` instead of `if self.required and value in EMPTY_VALUES:`)?

regards
webograph

Michael Radziej

oläst,
16 apr. 2007 07:16:272007-04-16
till django-d...@googlegroups.com
Hi webograph,

I cannot say whether it's right or wrong since I haven't done anything with
newforms (yet). From what you write, it looks like a but. Would you mind
opening a ticket on the ticket system, so that this doesn't get lost
accidentally?

So long,

Michael

--
noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The IT-Outsourcing Company

Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk -
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689

webograph

oläst,
16 apr. 2007 10:21:202007-04-16
till django-d...@googlegroups.com
filed in trac as ticket #4051
(http://code.djangoproject.com/ticket/4051)

webograph

Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden