Re: [web2py] Re: validators, form validation

2010-01-14 Thread KONTRA, Gergely
I cloned web2py and write 2 functions for that http://code.google.com/r/pihentagy-web2py/source/list You can use those classes like that: Field('invoice_date','date', requires=IS_DATE_IN_RANGE(minimum=datetime.date.today(), format='%d/%m/%Y')), Field('settlement_date','datetime', requires=

[web2py] Re: validators, form validation

2010-01-11 Thread mdipierro
Not sure I understand what is status enumeration. Any constant defined in models will be visible in controllers On Jan 11, 4:53 pm, "KONTRA, Gergely" wrote: > Hmm, seems to be not a good idea to write more topics in one > message... Anybody on the enumeration part? > +-[ Gergely Kontra  ]---

[web2py] Re: validators, form validation

2010-01-11 Thread KONTRA, Gergely
Hmm, seems to be not a good idea to write more topics in one message... Anybody on the enumeration part? +-[ Gergely Kontra  ]--+ |   | | Mobile:(+36 20)356 9656   | |

[web2py] Re: validators, form validation

2010-01-11 Thread mdipierro
On Jan 11, 11:19 am, pihentagy wrote: > On Jan 11, 2:57 pm, mdipierro wrote: > > > You can create your own field-level validators > > > class validator: > >    def __init__(self,error_message): self.error_message=error_message > >    def __call__(self,value): > >        if success: return (valu

[web2py] Re: validators, form validation

2010-01-11 Thread pihentagy
On Jan 11, 2:57 pm, mdipierro wrote: > You can create your own field-level validators > > class validator: >    def __init__(self,error_message): self.error_message=error_message >    def __call__(self,value): >        if success: return (value,None) >        else: return (value,self.error_messag

[web2py] Re: validators, form validation

2010-01-11 Thread mdipierro
You can create your own field-level validators class validator: def __init__(self,error_message): self.error_message=error_message def __call__(self,value): if success: return (value,None) else: return (value,self.error_message) both form.accept and crud.create/crud.update tak