you need to define your own validators like class VALIDATOR: def __init__(self,...): pass def __call__(self,value): if valid value: return (value,None) else: return (value, error_message)
On Jan 7, 2:22 am, Manakel <manakel...@gmail.com> wrote: > Hello All, > > I'm just discovering web2py and i'm not able to wrap my mind about the > Form level validation inside it. > > Let's say we talk about a defect. This defect has a "Fixing > Date" (date where provider deliver the fixing code in integration > system) and a "Closing Date" (date where the customer confirm issue is > solved in production system) > > Basically, i understand how i can check the data integrity when using > SQLForm. > -> this will check that the "Closing date" is a real date > But i don't understand how i can perform business level check when > using SQLForm > -> this may be real date , but it's a date in the future so i don't > allow the insertion/ update of the record (Business rules) > -> this may be a real date, and date is today or in the past, but it's > before the "Fixing Date" so i don't allow the insertion/ update of the > record (Business Rules) > > What is the recommended way to handle this kind of form level > validation in web2py? > (hopefully without having to save non valid data (versus business > rules) inside the db during the process) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---