def getImgList(self, count=1000): titles = [] try: models = ImgModel.all().order('-date').fetch(count) for model in models: titles.append(str(model.title)) return titles except: return 'Error'
def getImgList(self, count=1000): titles = [] try: models = ImgModel.all().order("-date").fetch(count) for model in models: titles.append(str(model.title)) return titles except: return "Error"
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'
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"
def load(self, title): try: model = ImgModel.gql('WHERE title =:1', title).get() return model.img except: return 'Error'
def load(self, title): try: model = ImgModel.gql("WHERE title =:1", title).get() return model.img except: return "Error"