google app engine - Cannot assign key to blobstore.BlobReferenceProperty() -
i trying upload photos blobstore. code similar example here
class image(ndb.model): date = ndb.datetimeproperty(auto_now_add=true) user = ndb.userproperty() blob_key = blobstore.blobreferenceproperty()
in uploadhandler following:
blob_info = self.get_uploads('file')[0] image = image() image.user = users.get_current_user() image.blob_key = blob_info.key()
however, last line results in following error:
typeerror: cannot concatenate 'str' , 'nonetype' objects
this driving me crazy. can upload picture, can't store key! know might wrong?
you have t revert data model db if want use blobreferenceproperty, not documented, if want use ndb need use blobkeyproperty mentioned voscausa. find db model simpler use ndb , don't hype round ndb
class image(db.model): user = db.userproperty() blob_key = blobstore.blobreferenceproperty()
Comments
Post a Comment