title: Google App Engine (python): filter users based on custom fields
body: <p>i am using the <code>webapp2_extras.appengine.auth.models.User</code> service which basically extends the <code>google.appengine.api.users model</code>. Now , I have custom users registered with my application and they have a lot of custom fields. The problem is i want to filter / (multi filter) all the users using various custom fields. For example: </p>
  
  <p>the user model has 2 fields <code>is_active</code> and <code>activation_key</code> now i want to filter them using these fields, example:</p>
  
  <pre><code>from google.appengine.api import users
  
  act_key = 'hw-2j38he63u83hd6hak3FshSqj3TGemn9'
  user = users.all().filter('is_active =', False).filter('activation_key =', act_key).get()
  if user:
    return True
  else:
    return False
  </code></pre>
  
  <p>what are the best possible ways to filter on the user model using custom fields?</p>
  
  <p>Edit:</p>
  
  <p>Also tried the following:</p>
  
  <pre><code>from webapp2_extras.appengine.auth.models import User
  
  query = User.query().filter('is_active =', False)
  print query
  </code></pre>
  
  <p>but this raises an error as follows:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/opt/google_appengine_1.6.4/google/appengine/ext/admin/__init__.py", line 320, in post
  exec(compiled_code, globals())
  File "&lt;string&gt;", line 6, in &lt;module&gt;
  File "lib/ndb/query.py", line 968, in filter
  raise TypeError('Cannot filter a non-Node argument; received %r' % arg)
  TypeError: Cannot filter a non-Node argument; received 'is_active ='
  </code></pre>