def upload(self, img, title): #status = '' def txn(): try: model = ImgModel() model.img = db.Blob(str(img)) model.title = title model.date = datetime.datetime.now() model.put() return 'Success' except: return 'Upload Error' status = db.run_in_transaction(txn) if status != 'UploadError': count_model = GenericCounter() count_model.increment('img') return status
def upload(self, img, title): # status = '' def txn(): try: model = ImgModel() model.img = db.Blob(str(img)) model.title = title model.date = datetime.datetime.now() model.put() return "Success" except: return "Upload Error" status = db.run_in_transaction(txn) if status != "UploadError": count_model = GenericCounter() count_model.increment("img") return status
def getModelNum(self): model = GenericCounter() return model.get_count('img')
def getModelNum(self): model = GenericCounter() return model.get_count("img")