[web2py] Re: Changing auth validator error messages

2012-11-28 Thread Daniele
I'd also like to change that error message value already in database or 
empty as I find it a pointless message.
But I tried with db.auth_user.email.requires[0].error_message = T(The 
email you have entered has already been registered.)
and it doesn't seem to change anything. Am I misplacing this? I put it in 
the db.py file after the 
auth.define_tables(username=False, signature=False)

Thanks

On Monday, September 17, 2012 3:21:00 AM UTC+1, 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?


-- 





[web2py] Re: Changing auth validator error messages

2012-11-28 Thread Mark Li
db.auth_user.email.requires[1].error_message = T(The email you have 
entered has already been registered.)

Try using the index of 1, not 0.


On Wednesday, November 28, 2012 4:55:54 PM UTC, Daniele wrote:

 I'd also like to change that error message value already in database or 
 empty as I find it a pointless message.
 But I tried with db.auth_user.email.requires[0].error_message = T(The 
 email you have entered has already been registered.)
 and it doesn't seem to change anything. Am I misplacing this? I put it in 
 the db.py file after the 
 auth.define_tables(username=False, signature=False)

 Thanks

 On Monday, September 17, 2012 3:21:00 AM UTC+1, 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?



-- 





[web2py] Re: Changing auth validator error messages

2012-11-28 Thread Daniele
Thanks, that did the trick!

On Thursday, November 29, 2012 12:30:31 AM UTC, Mark Li wrote:

 db.auth_user.email.requires[1].error_message = T(The email you have 
 entered has already been registered.)

 Try using the index of 1, not 0.


 On Wednesday, November 28, 2012 4:55:54 PM UTC, Daniele wrote:

 I'd also like to change that error message value already in database or 
 empty as I find it a pointless message.
 But I tried with db.auth_user.email.requires[0].error_message = T(The 
 email you have entered has already been registered.)
 and it doesn't seem to change anything. Am I misplacing this? I put it in 
 the db.py file after the 
 auth.define_tables(username=False, signature=False)

 Thanks

 On Monday, September 17, 2012 3:21:00 AM UTC+1, 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?



-- 





[web2py] Re: Changing auth validator error messages

2012-09-17 Thread Mark Li
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?



-- 





[web2py] Re: Changing auth validator error messages

2012-09-17 Thread Massimo Di Pierro
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?



-- 





[web2py] Re: Changing auth validator error messages

2012-09-17 Thread Mark Li
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?



-- 





[web2py] Re: Changing auth validator error messages

2012-09-16 Thread Massimo Di Pierro
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?


--