How to delete all entities for NDB Model in Google App Engine for python?

后端 未结 1 785
花落未央
花落未央 2021-02-05 09:55

I have a ndb model class:

class Game(ndb.Model):
    gameID = ndb.IntegerProperty()
    gameName = ndb.StringProperty()

Is there any way to qui

相关标签:
1条回答
  • 2021-02-05 10:37

    No, but you could easily do this with something like:

    from google.appengine.ext import ndb
    
    ndb.delete_multi(
        Game.query().fetch(keys_only=True)
    )
    
    0 讨论(0)
提交回复
热议问题