Let's say I have a model for my email address book:
class contact(db.Model):
email = db.EmailProperty()
image = #Hmm.
My contacts' images will be stored in the Blobstore, and served at various sizes.
So, should I use a db.ReferenceProperty(BlobInfo)
such that I can serve it by doing:
get_serving_url(alice.image.key, size=x)
Or should I use a db.StringProperty
so that I don't have to make the second read in order to get the key:
get_serving_url(alice.image, size=x)
Or should I use a db.LinkProperty
for the base URL, post-fixing the size needed:
alice.image+'=sx'
I don't foresee needing anything other than the key, so I think the second is better than the first.
Though I am unsure if the third is best because I am unsure whether it is as efficient as creating a unique URL, which can be cached to avoid repeatedly generating the same thumbnail - or is this handled automagically in both cases?