Il 06/09/15 22:25, kvthie0 ha scritto:
> Hello all,
>
> I'm learning the inner workings of web2py and try to make a custom
> validator called IS_TIME_IN_RANGE (based on the IS_DATE_IN_RANGE
> validator).
I suggest you to test the validator in a web2py console before using
it... in case of errors you'll get the traceback you expect :)
just do theese steps:
1. define your custom validator in a module called customvalidators.py
(for example)
2. open a web2py console with:
$ ./web2py -S yourapp # (in this case you don't need the model to be
load)
3. import the validator with:
from customvalidators import IS_TIME_IN_RANGE
4. test the validator with some controlled data that will returns known
results...
IS_TIME_IN_RANGE()(value)
good luck!
Cheers
Manuele
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.