Shhh! It's a secret.
Actually, it has been added to the new 4th edition, which should be
available online soon.
Anthony
On Thursday, December 15, 2011 7:06:21 PM UTC-5, ニコノコ wrote:
>
> Thanks Anthony. I don't think I've seen that in the docs.
>
> On Thursday, December 15, 2011, Anthony wrote:
>
>> Try
>>
>> IS_IN_DB(..., multiple=(0, 3))
>>
>> The "multiple" argument to IS_IN_SET and IS_IN_DB can be a list or tuple
>> specifying a minimum and maximum number of items to be selected (strictly
>> less than on the max, so set the max to 3 to make sure there are no more
>> than 2).
>>
>> Anthony
>>
>> On Wednesday, December 14, 2011 11:19:40 PM UTC-5, ニコノコ wrote:
>>>
>>> I have a list:reference field and would like a user to select none or up
>>> to two values from the list
>>>
>>> I could validate by calling onvalidation but I'm wondering if there's
>>> any built-in validator that should work? I've tried the following, none
>>> of which worked for me:
>>>
>>> - IS_LENGTH(minsize=0,maxsize=2)
>>> - IS_EXPR('len(value)<=2')
>>>
>>>
>>>
>>>