title: Is there anyway to iterate database object and call them?
body: <p>I have a database object <code>db</code> with fields</p>
  <pre class="lang-py prettyprint-override"><code>db.one = 1
  db.two = 2
  db.three = 3
  </code></pre>
  <p>Is there any way to do something like</p>
  <pre class="lang-py prettyprint-override"><code>require_comparison_list = [&quot;one&quot;, &quot;three&quot;]
  for field in dir(db):
     if field in reqire_comparison_list:
         print(db.field)
  </code></pre>
  <p>where <code>db.field</code> will give me 1 and 3.</p>
  <p>Thank you</p>