Annet, from your original post:
training=db().select(db.bedrijftraining.training,distinct=True)
form=form_factory(SQLField('plaatsnaam',label='Type een
plaatsnaam',requires=IS_NOT_EMPTY()),
SQLField('training', label='Selecteer een
activiteit',requires=IS_IN_DB(training,)))
you can not give an IS_IN_DB validator the options (its parameters are
dbset, field, label and error_message).
You could use an IS_IN_SET validator with a list, but the select in
the first line of the code above returns a SQLRows object not a list;
however the list can be created from it:
thelist=[training[i]['training'] for i in range(len(training))]
(I would change the name of the SQLRows object, too many 'training'
can be confusing).
so now: ...,requires=IS_IN_SET(thelist)...
But this begs the question, how useful is that field if it does not
have the id of the entry in the db?. Only you can answer that.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---