title: How to repopulate SQLFORM fields in an edit form page in web2py
body: <p>I am trying to write an edit form function where the fields in the displayed form on the page are already populated with the corresponding entry. </p>
  
  <p>I have two different databases that store the data for the form. I have tried running a query on the databases to check which entry matches the form id for the entry that is being edited, but that returns a value of none. </p>
  
  <pre class="lang-py prettyprint-override"><code>def edit():
      q1 = ((db.form1 == request.args(0))
      q2 = ((db.form2 == request.args(0))
      form = SQLFORM.factory(db.form1, db.form2)
      form.vars = q1
      form.vars = q2
      return dict(form=form)
  </code></pre>
  
  <p>I expected for the query to return the record that matches the form id for that record, but it returns NULL.</p>