Best way to link datastore entity to its blobstore image?

Deadly 提交于 2019-12-07 08:23:28

After some experimentation, I think I can answer my own question.

Well, sort of. It turns out that the answer is "this wasn't a real problem to begin with".

While get_serving_url() gives the impression that something fancy is being done, actually the 'serving URL' is nothing more than a post-fixing of the supplied BlobKey.

What's more, supplying size=x merely appends =sx - there's nothing special, more or less efficient, about doing it this way. My second and third options, really are identical.

Finally, the __BlobInfo__ entity kind uses the BlobKey as its key name, so it is also easy to access from the other.


I have decided to use, and would suggest to anyone with the same dilemma, my third option:

imgBlob = db.LinkProperty()

It is then easy to:

  • append any resizing/cropping requirements
  • give a default value/make required without overloading put()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!