title: How do I update a query from Google App Engine NDB?
body: <p>We are using Google App Engine in Python. I have code that saves a new object to the database, and then queries the database to receive all the objects. The problem is that the query returns all the objects except the new object I created. Only after refreshing the page I see the new object. Is there a way to update the query to include all the objects, including the new object I created? Here is my code:</p>
  
  <pre><code>if (self.request.get("add_a_new_feature") == "true"):
      features = Feature.gql("WHERE feature_name=:1 ORDER BY last_modified DESC LIMIT 1", NEW_FEATURE_NAME) # class Feature inherits from ndb.Model
      if (features.count() == 0):
          new_feature = Feature(feature_name=NEW_FEATURE_NAME)
          new_feature.put()
  ...
  features = Feature.gql("ORDER BY date_created")
  if (features.count() &gt; 0):
      features_list = features.fetch()
      for feature in features_list:
          ... # the list doesn't contain new_feature
  </code></pre>