Reputation: 146
I am wondering about what the best way of saving a blobstore reference The documented way would be like so:
blobstore.BlobReferenceProperty()
or
ndb.BlobKeyProperty()
or
db.StringProperty()
Are there any disadvantages to save a text string of the key?
Upvotes: 2
Views: 114
Reputation: 26643
blobstore.BlobReferenceProperty
That works in my apps and if you need an image class that can hold several images you can use something like
class Image(db.Model):
reference = db.ReferenceProperty(Article,
collection_name='matched_images', verbose_name='Title')
primary_image = blobstore.BlobReferenceProperty()
Upvotes: 1