I have this class representing my model :
from google.appengine.ext import db
class PuzzleSets(db.Model):
img = db.BlobProperty(required=True)
...
and I want to retrieve that blobproperty. However, I want to retrieve the bytes array and output it to a string. Ex. : “AE214FAA21617772” for a 8 bytes image stored in my blob.
I tried with a blob_reader and some other methods but I always get errors like
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0x89 in position 0: invalid start byte
or
hex() argument can’t be converted to hex
and such
Anyone can help me get the correct way to do this?
Thanks!
I finally got what I wanted with this sleek line of code :