Update:
I found success adapting the body of GetSchemaKinds() from
bulkloader.py:

  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)



On Mar 29, 6:12 pm, kostmo <[email protected]> wrote:
> I tried to use the body of the get_kinds() function (after adding the
> line "from google.appengine.api import datastore_admin"), but I get
> the error:
>
> BadRequestError: app [myappname] cannot call GetSchema
>
> Karl
>
> On Mar 25, 2:19 pm, mstodd <[email protected]> wrote:
>
> > Well, the admin interface canlistthem, so I tracked down how that's
> > happening, and it's in google/google_appengine/google/appengine/ext/
> > admin/__init__.py
>
> > 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.
>
> > On Mar 24, 7:46 pm, Trung <[email protected]> wrote:
>
> > > Hi,
>
> > > I'd like to know whether we canprogrammaticallyknow thelistof
> > >entity
> > > KIND currently in the datastore.
>
> > > Thanks in advance.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to