On Oct 29, 2009, at 1:05 PM, mdipierro wrote:

> ok make you search for all occurrences in applications/example/  and
> gluon/

There's preliminary code here: 
http://lobitos.net/web2py-patches/gluon/validators.py

If that looks generally OK, please let me know and I'll complete the  
patch.

The changes are:

* create IS_EMPTY_OR, same as IS_NULL_OR
* create a common empty-field test for IS_EMPTY_OR and IS_NOT_EMPTY to  
share
* allow specification of an arbitrary string to be treated as 'empty'
* doctests all around

>
> On Oct 29, 2:46 pm, Jonathan Lundell <jlund...@pobox.com> wrote:
>> On Oct 29, 2009, at 10:36 AM, mdipierro wrote:
>>
>>
>>
>>> I hate these kind of changes because they affect syntax highlighing
>>> and a lot of example pages. Do you feel strongly about this?
>>
>> Not so strongly. Only that a difference in name suggests a difference
>> in meaning, and when that's not true, it's confusing.
>>
>> I'll generate a patch that'll let you decide what to keep.
>>
>>
>>
>>> On Oct 29, 12:25 pm, Jonathan Lundell <jlund...@pobox.com> wrote:
>>>> On Oct 29, 2009, at 10:14 AM, Jonathan Lundell wrote:
>>
>>>>> On Oct 29, 2009, at 9:57 AM, mdipierro wrote:
>>
>>>>>> send me a patch
>>
>>>>> OK.
>>
>>>>> Do you want to strip spaces? White space generally? If so, should
>>>>> IS_NULL_OR do the same?
>>
>>>> I see that stripping is there already.
>>
>>>> Another question: why isn't IS_NULL_OR called IS_EMPTY_OR? Is  
>>>> there a
>>>> distinction intended between null and empty (in this context)?
>>
>>>> If they're the same, how about changing IS_NULL_OR to IS_EMPTY_OR,
>>>> for
>>>> consistency, and preserving IS_NULL_OR as a deprecated alias for
>>>> IS_EMPTY_OR?
>>
>>>>>> On Oct 29, 11:31 am, Jonathan Lundell <jlund...@pobox.com> wrote:
>>>>>>> On Oct 29, 2009, at 9:23 AM, mdipierro wrote:
>>
>>>>>>>> You can already do that by piping cleanup which would remove
>>>>>>>> unmached
>>>>>>>> charatacters or using IS_MATCH() validator.
>>
>>>>>>> CLEANUP obviates the need for any change at all (and it doesn't
>>>>>>> really
>>>>>>> do what I'm suggesting). MATCH might. But the point of the  
>>>>>>> change
>>>>>>> you're suggesting is the same as the one I'm suggesting:  
>>>>>>> IS_EMPTY
>>>>>>> should match non-empty strings that "count as empty". It's
>>>>>>> syntactic
>>>>>>> sugar merely, but sweet nonetheless.
>>
>>>>>>>> On Oct 29, 11:18 am, Jonathan Lundell <jlund...@pobox.com>  
>>>>>>>> wrote:
>>>>>>>>> On Oct 29, 2009, at 9:01 AM, mdipierro wrote:
>>
>>>>>>>>>> I do not disagree. Shall we make is_not_empty strip?
>>
>>>>>>>>> If it's going to change, how about (also) an optional  
>>>>>>>>> argument,
>>>>>>>>> defaulting to None, that's a string that counts as empty? I'm
>>>>>>>>> thinking
>>>>>>>>> of the case in which you put instructions to the user in a
>>>>>>>>> field,
>>>>>>>>> like
>>>>>>>>> "first name" in the first_name field. In that case, it'd be
>>>>>>>>> convenient
>>>>>>>>> of "first name" counted as EMPTY.
>>
>>>>>>>>>> On Oct 29, 10:43 am, Thadeus Burgess <thade...@thadeusb.com>
>>>>>>>>>> wrote:
>>>>>>>>>>> Ok, I guess I just figured that IS_NOT_EMPTY would check for
>>>>>>>>>>> if
>>>>>>>>>>> the
>>>>>>>>>>> string
>>>>>>>>>>> was blank as well.
>>
>>>>>>>>>>> Thanks for clarifying
>>
>>>>>>>>>>> -Thadeus
>>
>>>>>>>>>>> On Thu, Oct 29, 2009 at 10:40 AM, mdipierro
>>>>>>>>>>> <mdipie...@cs.depaul.edu> wrote:
>>>>>>>>>>>> tually is CLEANUP()  or CLENAUP(regex='.') that does that.
>>>>>>>>>>>> I do not think we agreed to anything el



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to