我正在尝试使用 python 中的以下代码在谷歌应用商店中调用实体的特定模型:
class Profile(BlogHandler):
def get(self):
user = users.get_current_user()
if user:
user = users.get_current_user()
user_db_qry = User.query(User.theid == user.federated_identity())
#theid is how I have saved each user's federated id in the User entity in the datastore
user_db_list = user_db_qry.fetch(1)
profile_user = user_db_list[0]
profile_id = profile_user.key().id_or_name()
#I am trying to get the datastore created ID/Name here and this is the line that gives me the error
self.redirect('/profile/%s' % str(profile_id))
else:
self.redirect("/about")
所以我不太确定出了什么问题。我的查询不正确吗?