Just realized I added the following lines after my db.define_table
statement:
db.sometable.start_time.notnull = True
db.sometable.start_time.requires = IS_NOT_EMPTY()
I'm thinking that my assignment of IS_NOT_EMPTY() overwrote the default
IS_TIME() validator associated with time fields. Doe
requires can be a list of validators.
On Tuesday, November 12, 2013 9:32:27 AM UTC+1, User wrote:
>
> Just realized I added the following lines after my db.define_table
> statement:
>
> db.sometable.start_time.notnull = True
> db.sometable.start_time.requires = IS_NOT_EMPTY()
>
>
> I'm th
So since a time field automatically has an IS_TIME validator how would you
specify additional validators after the db.define_table statement?
On Tuesday, November 12, 2013 3:51:12 AM UTC-5, Niphlod wrote:
>
> requires can be a list of validators.
>
> On Tuesday, November 12, 2013 9:32:27 AM U
db.table.field.requires.append(what_you_need)
On Wednesday, November 13, 2013 6:43:38 AM UTC+1, User wrote:
>
> So since a time field automatically has an IS_TIME validator how would you
> specify additional validators after the db.define_table statement?
>
> On Tuesday, November 12, 2013 3:51:12
Does this need the original validator to have been defined as a list to
work?
Is there a difference between
db.table.field.requires = first_validator
and
db.table.field.requires = [first_validator]
Does your append code work in either case? If there is a difference, when
you declare a field
>
> Does this need the original validator to have been defined as a list to
> work?
>
it depend, wheter you need 1 validator or more than 1 validator, if more
than 1 validator please use list of validators [].
> db.table.field.requires = first_validator
>
use it if you only need 1 validator
6 matches
Mail list logo