1
下面这组查询连接了一系列配置文件,并返回到网站。订购查询
我想用这些做一个查询,因为我想在整个配置集合上使用order函数。
# Get all users for who 'currentUser' is an assistant for.
users = Users.query(Users.assistant.IN(currentUser)).fetch()
# Get all profiles that belong to those users and have not been deleted.
for user in users:
profiles = profiles + Profiles.query(
ndb.AND(
Profiles.user == user.username,
Profiles.deleted == False
)
).order(Profiles.history).fetch() # Order all profiles by timestamp
工作就像一个魅力,谢谢你! –