title: Why do two logically similar queries in web2py give different results?
body: <p>I've been struggling with this for a while and just tried moving the conditions around on a whim. Why does it work one way and not the other?</p>
  
  <p>On this table definition:</p>
  
  <pre><code>db.define_table('bids',
                   Field('body', 'text', label="Application"),
                   Field('selected', 'string', requires=IS_IN_SET(['Yes', 'No']), readable=False, writable=False, default='No', widget=SQLFORM.widgets.radio.widget, label="Select this application"), 
                   Field('confirmed', 'string', requires=IS_IN_SET(['Yes', 'No']), readable=False, writable=False, default='No', widget=SQLFORM.widgets.radio.widget, label="Confirm acceptance"),
                   Field('delivered', 'string', requires=IS_IN_SET(['Yes', 'No']), readable=False, writable=False, default='No'),
                   Field('posted_on', 'datetime', readable=True, writable=False),
                   Field('posted_by', 'reference auth_user', readable=False, writable=False),
                   Field('job_id', 'reference jobs', readable=False, writable=False)
                   )
  </code></pre>
  
  <p>This query yields the correct data</p>
  
  <pre><code>query = db.bids.job_id == job_id and db.bids.delivered=='No' and db.bids.selected =='Yes' and db.bids.confirmed=='Yes'
  </code></pre>
  
  <p>while this one doesn't</p>
  
  <pre><code>query = db.bids.job_id == job_id and db.bids.selected =='Yes' and db.bids.confirmed=='Yes' and db.bids.delivered=='No'
  </code></pre>