Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
newforms: [] not in EMPTY_VALUES
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
webograph  
View profile  
 More options Apr 13 2007, 3:03 pm
From: webograph <webogr...@eml.cc>
Date: Fri, 13 Apr 2007 21:03:00 +0200
Subject: newforms: [] not in EMPTY_VALUES
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Radziej  
View profile  
 More options Apr 16 2007, 7:16 am
From: Michael Radziej <m...@noris.de>
Date: Mon, 16 Apr 2007 13:16:27 +0200
Local: Mon, Apr 16 2007 7:16 am
Subject: Re: newforms: [] not in EMPTY_VALUES
Hi webograph,

On Fri, Apr 13, webograph wrote:
> 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:`)?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newforms: [] not in EMPTY_VALUES -- ticket opened" by webograph
webograph  
View profile  
 More options Apr 16 2007, 10:21 am
From: webograph <webogr...@eml.cc>
Date: Mon, 16 Apr 2007 16:21:20 +0200
Local: Mon, Apr 16 2007 10:21 am
Subject: Re: newforms: [] not in EMPTY_VALUES -- ticket opened
filed in trac as ticket #4051
(http://code.djangoproject.com/ticket/4051)

webograph


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »