我正在一个网站上工作,用户可以上传与某个位置相关的帖子,然后他们可以添加两张或三张照片以便与之一起使用。我了解如何使用Datastore或Blobstore进行基本上传,但我希望将这些照片链接到帖子和用户,然后能够在连接到帖子和用户的所有页面中显示它们。
这是一般的想法,但要更具体一些,我试图弄清楚是否仅仅为了给发布实体3 db.blob属性并采取一些命中更高的数据成本或者是否可以将Blobstore实体与我的数据存储实体链接。 这就是 BlobReferenceProprty 适用于。您可以将模型中的引用添加到模型中,这似乎是您想要的。
I am working on a website where the user can upload a post relating to a location and then they can add two or three photos to go along with it. I understand how to do a basic upload with either the Datastore or the Blobstore but I want to link these photos to the post and to the user and then be able to display them in all pages connected to the post and the user.
That is the general idea but to be more specific I am trying to figure out if it would be easier to just to give the post entities 3 db.blob attributes and take a little hit on higher data costs or if it is doable to link the Blobstore entities with my Datastore entities.
解决方案That's what BlobReferenceProprty is for. You can add a reference to a blob into model which seems to be what you want.
更多推荐
在Google App Engine中上传图片
发布评论