title: web2py FORM - lookup value by string field instead of ID
body: <p>I have a model like this in web2py:</p>
  
  <pre><code>db.define_table('courses',
      Field('course_name','string'))
  
  
  db.define_table('auth_user',
      ....
      ....
      Field('course_name',db.courses,label=T('Course Name'),
          required=True,
          requires=IS_IN_DB(db,db.courses.id,'%(course_name)s'),
  </code></pre>
  
  <p>If I display a form based on the auth_user table, the <code>auth_user.course_name</code> field is represented by a dropdown menu containing all of the courses in <code>courses</code> table. As expected, it displays them using the contents of the <code>courses.course_name</code> field, and not the <code>courses.ID</code> field (because of the string format representation in the IS_IN_DB requirement.</p>
  
  <p>However, I'm trying to modify it such that instead of using a dropdown select menu, it just displays a text field. I'm expecting the user to be able to enter the name of a course, and the form will work properly as long as that name is a valid <code>course_name</code>. </p>
  
  <p>To do that, I added a <code>widget=SQLFORM.widgets.string.widget</code> property to the <code>auth_user.course_name</code> field. That correctly displays a text box instead of the dropdown, but doesn't allow the user to enter a <code>course_name</code>. It works fine if a valid <code>courses.id</code> is entered (and displays the expected error message if it's not a valid ID).</p>
  
  <p>However, I can't figure out how to make it accept a <code>course_name</code> instead of the ID. I could theoretically use the autocomplete plugin (which does indeed work), but the purpose of this is to allow the user to only submit the form if they know the valid <code>course_name</code> (it's kind of like a password).</p>
  
  <p>Is this possible?</p>