How to get the number of rows in a table in a Datastore?
问题 In many cases, it could be useful to know the number of rows in a table (a kind) in a datastore using Google Application Engine. There is not clear and fast solution . At least I have not found one.. Have you? 回答1: You can efficiently get a count of all entities of a particular kind (i.e., number of rows in a table) using the Datastore Statistics. Simple example: from google.appengine.ext.db import stats kind_stats = stats.KindStat().all().filter("kind_name =", "NameOfYourModel").get() count