[web2py] Re: is such work with current.T() correct and safe?

2016-05-25 Thread Anthony
> > from gluon import current > from gluon.validators import IS_NOT_EMPTY, IS_IN_DB > class FormTxt(object): >err_choose = current.T('choose one or more') >err_required = current.T('this is required') > The purpose of translation is to translate strings based on the requested language of

[web2py] Re: is such work with current.T() correct and safe?

2016-05-26 Thread Mirek Zvolský
Thank you very much, Anthony. Just the first sentence "...The purpose of translation is to translate strings based on the requested language of a given HTTP request" is enough to understand my stupid mistake. Dne středa 25. května 2016 12:21:35 UTC+2 Mirek Zvolský napsal(a): > > I underst

[web2py] Re: is such work with current.T() correct and safe?

2016-05-26 Thread Mirek Zvolský
I hope this is better: from gluon import current from gluon.validators import IS_NOT_EMPTY, IS_IN_DB class IS_NOT_EMPTY_(IS_NOT_EMPTY): def __init__(self): super(IS_NOT_EMPTY_, self).__init__(error_message=current.T('this is required')) class IS_IN_DB_(IS_IN_DB): def __init__(self, *

[web2py] Re: is such work with current.T() correct and safe?

2016-05-26 Thread Mirek Zvolský
.__init__(*args, error_message=current.T('choose one or more', **kwargs)) in last Dne čtvrtek 26. května 2016 11:27:38 UTC+2 Mirek Zvolský napsal(a): > > I hope this is better: > > from gluon import current > from gluon.validators import IS_NOT_EMPTY, IS_IN_DB > class IS_NOT_EMPTY_(IS_NOT_EMPTY):

[web2py] Re: is such work with current.T() correct and safe?

2016-05-26 Thread Anthony
On Thursday, May 26, 2016 at 5:27:38 AM UTC-4, Mirek Zvolský wrote: > > I hope this is better: > > from gluon import current > from gluon.validators import IS_NOT_EMPTY, IS_IN_DB > class IS_NOT_EMPTY_(IS_NOT_EMPTY): >def __init__(self): >super(IS_NOT_EMPTY_, self).__init__(error_message