title: What is the difference between .get() and .fetch(1)
body: <p>I have written an app and part of it is uses a URL parser to get certain data in a ReST type manner. So if you put /foo/bar as the path it will find all the bar items and if you put /foo it will return all items below foo</p>
  
  <p>So my app has a query like</p>
  
  <pre><code>data = Paths.all().filter('path =', self.request.path).get()
  </code></pre>
  
  <p>Which works brilliantly. Now I want to send this to the UI using templates</p>
  
  <p>{% for datum in data %}
      
      <h2>{{ datum.title }}</h2>
      {{ datum.content }}</p>
  
  <pre><code>   &lt;/div&gt;
  </code></pre>
  
  <p>{% endfor %}</p>
  
  <p>When I do this I get data is not iterable error. So I updated the Django to <code>{% for datum in data.all %}</code> which now appears to pull more data than I was giving it somehow. It shows all data in the datastore which is not ideal. So I removed the .all from the Django and changed the datastore query to </p>
  
  <pre><code>data = Paths.all().filter('path =', self.request.path).fetch(1)
  </code></pre>
  
  <p>which now works as I intended. In the documentation it says</p>
  
  <blockquote>
    <p>The db.get() function fetches an
    entity from the datastore for a Key
    (or list of Keys).</p>
  </blockquote>
  
  <p>So my question is why can I iterate over a query when it returns with <code>fetch()</code> but can't with <code>get()</code>. Where has my understanding gone wrong?</p>