[英]how to get all the datastore results just with a key?
I am pretty new to Python and GAE. 我对Python和GAE很陌生。 Busy building a simple blog to learn.
忙着建立一个简单的博客来学习。 Was wondering, how can I get the datastore entries?
想知道如何获取数据存储条目?
This is how my DB object looks like : 这就是我的数据库对象的样子:
class BlogArticles(db.Model):
author = db.UserProperty()
article_name = db.StringProperty()
article = db.TextProperty()
date = db.DateTimeProperty(auto_now_add=True)
Can I get say author and article from passing the key to something like 我可以通过将密钥传递给类似的内容来说作者和文章吗
db.get(key_value)
aah figured it out :) 啊想通了:)
Here is how I did it...so simple. 这是我的操作方法……非常简单。
all_data = db.get(edit_article)
article_name = all_data.article_name
article = all_data.article
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.