擅长:python、mysql、java
<p><code>ndb.Model</code>实例有一个<code>to_dict()</code>函数:
<a href="https://developers.google.com/appengine/docs/python/ndb/modelclass#Model_to_dict">https://developers.google.com/appengine/docs/python/ndb/modelclass#Model_to_dict</a></p>
<p>最简单的方法是:</p>
<pre><code>json.dumps([p.to_dict() for p in Pasta.query(Pasta.name == "Ravioli").fetch()])
</code></pre>