title: Multiple field filtering using pyDAL
body: <p><strong>EDIT: I think I solved it, I added the answer.</strong></p>
  
  <p>I am writing a REST API using python,
  Falcon as the web framework and pyDAL as the DAL for MySQL.</p>
  
  <p>I want to filter(where statement) using the fields that I get in the query string of the get request.</p>
  
  <p>For example I receive the the following get request:</p>
  
  <pre><code>http://127.0.0.1:5000/users?firstName=FirstN&amp;id=1
  </code></pre>
  
  <p>And I want that pyDAL will query generate the following SQL:</p>
  
  <pre><code>SELECT * FROM users WHERE firstName = 'FirstN' AND id = '1'
  </code></pre>
  
  <p>I could not find something that can do that because pyDAL would like to receive something like:</p>
  
  <pre><code>self.db((self.db.users.id == 1) &amp; (self.db.users.firstName == 'FirstN')).select()
  </code></pre>
  
  <p>But I can't specify the fields because I don't know which field I am going to filter on, Thats why I wrote this:</p>
  
  <pre><code>def on_get(self, req, resp):
      if req.query_string is not '':
          input = req.query_string
          sql = 'SELECT * FROM users WHERE '
          sql += ' AND '.join(['{col} = \'{value}\''.format(col=item.split('=')[0], value=item.split('=')[1]) for item in input.split('&amp;')])
          resp.body = json.dumps(self.db.executesql(sql, as_dict=True))
      else:
          resp.body = json.dumps(self.db(self.db.users).select().as_dict())
  </code></pre>
  
  <p>But I think is is awful and should be a better why.</p>