[Zope3-dev] bug setting value to None via edit form

Steve Alexander steve@cat-box.net
Sun, 13 Jul 2003 11:43:42 +0300


>>> I think the approach you're taking is pretty esotheric. I'd like to see
>>> some use cases for making anything other than None a 'missing' value.
>>
>>
>> 1: Text
>>
>> In general, I want to consider an empty string to be "missing".
> 
> 
> I disagree - an empty string is only missing if it has a minimum length 
>  > 0.

I agree with you. I implied that an empty string is only missing if it 
has a minimum length > 0 when I said in my last message:

   The only time I'd want to use a value of None for something that is
   usually a string is when '' is valid and meaningful data that has been
   set for that string.


In most of my applications, I want to use an empty string as the missing 
value, and I consider 1 as the minimum length of a non-missing string.

I test whether a string is present or absent using a simple if test:

   if self.someString:
       # the string is present

--
Steve Alexander