Some of the information here may be outdated, please check the book instead
[edit]

Consider:

db.recipe.category.requires=IS_IN_DB(db,'category.id','category.name')

The parameters are:

  1. a set of records
  2. category.id describes how the field will be represented in the database
  3. category.name describes how the field will be represented to the user

For example you can do things like:

requires=IS_IN_DB(db(db.category.name.like('d%')),
                  'category.id',
                  'Name: %(name)s, id: %(id)s any text your like')
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.