Exemple #1
0
 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'
Exemple #2
0
 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"
Exemple #3
0
 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'
Exemple #4
0
 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"
Exemple #5
0
 def load(self, title):
     try:
         model = ImgModel.gql('WHERE title =:1', title).get()
         return model.img
     except:
         return 'Error'
Exemple #6
0
 def load(self, title):
     try:
         model = ImgModel.gql("WHERE title =:1", title).get()
         return model.img
     except:
         return "Error"