我正在使用 ParsePy ( https://github.com/milesrichardson/ParsePy ),现在我遇到了文件删除问题。
from parse_rest.datatypes import Object, File
class GameScore(Object):
pass
with open('/path/to/screenshot.png', 'rb') as fh:
rawdata = fh.read()
screenshotFile = File('arbitraryNameOfFile', rawdata, 'image/png')
screenshotFile.save()
gs = GameScore.Query.get(objectId='xxxxxxx')
gs.screenshot = screenshotFile
gs.save()
#
# In another function
#
class GameScore(Object):
pass
gs = GameScore.Query.get(objectId='xxxxxxx')
gs.screenshot.delete()
# Error: No JSON object could be decoded
有什么建议吗?提前致谢。洛里斯