在Google App Engine中上传图片 [英] Image Upload in Google App Engine

查看:88
本文介绍了在Google App Engine中上传图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个网站上工作,用户可以上传与某个位置相关的帖子,然后他们可以添加两张或三张照片以便与之一起使用。我了解如何使用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中上传图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆