How to get all records from GAE datastore with particular parent?

纵然是瞬间 提交于 2020-01-16 02:56:25

问题


I have several records in my database with the same parent. How can I get all of them by parent?


回答1:


OK, looks like the following code works:

items = ITEM.gql('WHERE ANCESTOR IS :parent', parent=parent_key).fetch(5)


来源:https://stackoverflow.com/questions/7868333/how-to-get-all-records-from-gae-datastore-with-particular-parent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!