Beispiel #1
0
 def AddAlbum(self,request):
     album = datastore.Entity("Album")
     album["album_username"] = "******"
     album["album_type"] = "public"
     album["access"] = "public"
     album["date"] = datetime.datetime.now()
     album["valid"] = False
     album["order"] = 0
     album["owner"] = users.GetCurrentUser()
     datastore.Put(album)
     util.flushAlbumList()
     album['key'] = str(album.key())
     album['id'] = str(album.key().id())
     album["date"] = album["date"].strftime('%m/%d/%y')
     album["owner"] = str(album["owner"].email())
     return album
Beispiel #2
0
 def UpdateAlbum(self,request):
     album = Album.get_by_id(int(request.get("id")))
     editColumn = request.get("editColumn")
     if album and editColumn:
         newData = request.get("newData")
         if editColumn == "album_username":
           album.album_username = newData
         if editColumn == "album_type":
           album.album_type = newData
         if editColumn == "access":
           album.access = newData
         if editColumn == "date":
           album.date = simplejson.loads(newData)
         if editColumn == "order":
           album.order = simplejson.loads(newData)
         if editColumn == "valid":
           album.valid = simplejson.loads(newData)
         album.put()
         util.flushAlbumList()
     return True
Beispiel #3
0
 def DeleteAlbum(self,request):
     album = Album.get_by_id(int(request.get("id")))
     album.delete()
     util.flushAlbumList()
     return True