Awesome, that worked and I didn't have to redefine the other validators for 
auth_user.email

On Monday, September 17, 2012 11:52:38 AM UTC-7, Massimo Di Pierro wrote:
>
> sorry. Try:
>
> db.auth_user.email.requires[0].error_message = T("....")
>
> On Monday, 17 September 2012 11:40:24 UTC-5, Mark Li wrote:
>>
>> Ok that answers my question; I would still have to define all the 
>> validators for auth_user.email (assuming there is more than one).
>>
>> Also just for claficiation, using the following:
>> db.auth_user.email.requires.error_message = T("....")
>>
>>
>> gives me the following error message: 
>> <type 'exceptions.AttributeError'> 'list' object has no attribute 
>> 'error_message'
>>
>>
>>
>>
>>
>> On Sunday, September 16, 2012 7:37:52 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> I think you can do:
>>>
>>> db.auth_user.email.requires.error_message = T(....)
>>>
>>> Unless they have more then one validator.
>>>
>>> On Sunday, 16 September 2012 21:21:00 UTC-5, Mark Li wrote:
>>>>
>>>> Is it possible to change the validator error messages in for auth 
>>>> fields like "value already in database or empty," without having to 
>>>> redefine all the validators for that field? For example, I wanted to 
>>>> change 
>>>> the validator error message for IS_NOT_IN_DB for auth_user.email, and I 
>>>> wrote:
>>>>
>>>> db.auth_user.email.requires=IS_NOT_IN_DB(db, auth_user.email,error_message
>>>> =T("Email already in use"))
>>>>
>>>>
>>>> Would I have to define all the validators for auth_user.email now? Is 
>>>> there a less intrusive way of changing the error message without 
>>>> overriding 
>>>> the default validators for auth?
>>>>
>>>

-- 



Reply via email to