how to delete NDB entity using ID?

后端 未结 1 568
面向向阳花
面向向阳花 2021-01-12 20:28

based on this docs https://developers.google.com/appengine/docs/python/ndb/entities#deleting_entities well, im still not sure why i cannot do the delete on NDB:

<         


        
相关标签:
1条回答
  • 2021-01-12 21:03

    Try this:

    ndb.Key(category, int(id)).delete()
    

    You need to convert the id to integer in order to build a numeric (id) key instead of a name key.

    0 讨论(0)
提交回复
热议问题