How do I get a list of namespaces on google app engine?

后端 未结 4 1570
孤独总比滥情好
孤独总比滥情好 2021-02-04 08:51

I would like to make a backup of all user data in the datastore. My application is using the new namespace feature to provide multi tenanting on a per user basis (as per the ex

4条回答
  •  情深已故
    2021-02-04 09:21

    There is also now a get_namespaces() function:

    from google.appengine.ext.db import metadata
    
    namespaces = metadata.get_namespaces() 
    

    get_namespaces() returns a list of Namespace objects. The docs also note that "metadata queries that fetch information on namespaces, kinds, and properties are generally slow to execute."

提交回复
热议问题