I'd like to know whether we can programmatically know the list of
entity
KIND currently in the datastore.
Thanks in advance.
check out get_kinds() in that file.
looks like it just uses datastore_admin from google.appengine.api
let me know if you get stuck.
BadRequestError: app [myappname] cannot call GetSchema
Karl
On Mar 25, 2:19 pm, mstodd <toaste...@gmail.com> wrote:
> Well, the admin interface canlistthem, so I tracked down how that's
def GetSchemaKinds(self):
"""Returns the list of kinds for this app."""
class KindStatError(Exception):
"""Unable to find kind stats for an all-kinds download."""
from google.appengine.ext.db import stats
global_stat = stats.GlobalStat.all().get()
if not global_stat:
raise KindStatError()
timestamp = global_stat.timestamp
kind_stat = stats.KindStat.all().filter(
"timestamp =", timestamp).fetch(1000)
kind_list = [stat.kind_name for stat in kind_stat
if stat.kind_name and not
stat.kind_name.startswith('__')]
kind_set = set(kind_list)
return list(kind_set)