Quick question,
If I put my validators in the model like this:
db.data.speedtesturl.requires=IS_NOT_IN_DB(db,
'data.speedtesturl',error_message='This speedtest URL is already in
the database. Please provide another')
They only seem to work if I use SQLFORM.
If I create a SQLFORM and then add an extra field to it like this:
speedtesturl=TR(LABEL('Speedtest
URL'),INPUT(_name='speedtesturl',_type='text',))
form[0].insert(-1,speedtesturl)
and then add the data to the database a little later like this:
db.data.insert(**dict(form.vars))
The validator doesn't validate the data from the extra field.
To validate the data in the extra field I have to call the validator
in the controller like this:
speedtesturl=TR(LABEL('Speedtest
URL'),INPUT(_name='speedtesturl',_type='text',
requires=IS_NOT_IN_DB(db, 'data.speedtesturl')))
Am I right in thinking then that validators written in the model only
work against data submitted using SQLFORM, and not against data
submitted in other ways?
Thanks,
Chris