How to use the webserver.LibraryMethods.LibraryEntry function in webserver

To help you get started, we’ve selected a few webserver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github klnusbaum / UDJ-Server / webserver / LibraryMethods.py View on Github external
def addSongToLibrary(to_add, db):
  idreturn = db.insert('library', 
    song=to_add['song'],
    artist=to_add['artist'],
    album=to_add['album'],
    hostId=to_add['host_lib_song_id'])
  toReturn = db.select(
    'library', 
    where=web.db.sqlwhere({'id' : idreturn})
  )
  row = toReturn[0]
  return LibraryEntry(row.id, row.hostId, row.song, row.artist, row.album, row.isDeleted)
github klnusbaum / UDJ-Server / webserver / LibraryMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, LibraryEntry):
      return {
        LibraryEntry.SERVER_ID_PARAM : obj.getServerId(),
        LibraryEntry.HOST_ID_PARAM : obj.getHostId(),
        LibraryEntry.SONG_PARAM : obj.getSong(),
        LibraryEntry.ARTIST_PARAM : obj.getArtist(),
        LibraryEntry.ALBUM_PARAM : obj.getAlbum(),
        LibraryEntry.IS_DELETED_PARAM : obj.getDeleteStatusString(),
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Android-Client / webserver / LibraryMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, LibraryEntry):
      return {
        LibraryEntry.SERVER_ID_PARAM : obj.getServerId(),
        LibraryEntry.HOST_ID_PARAM : obj.getHostId(),
        LibraryEntry.SONG_PARAM : obj.getSong(),
        LibraryEntry.ARTIST_PARAM : obj.getArtist(),
        LibraryEntry.ALBUM_PARAM : obj.getAlbum(),
        LibraryEntry.IS_DELETED_PARAM : obj.getDeleteStatusString(),
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Server / webserver / LibraryMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, LibraryEntry):
      return {
        LibraryEntry.SERVER_ID_PARAM : obj.getServerId(),
        LibraryEntry.HOST_ID_PARAM : obj.getHostId(),
        LibraryEntry.SONG_PARAM : obj.getSong(),
        LibraryEntry.ARTIST_PARAM : obj.getArtist(),
        LibraryEntry.ALBUM_PARAM : obj.getAlbum(),
        LibraryEntry.IS_DELETED_PARAM : obj.getDeleteStatusString(),
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Android-Client / webserver / LibraryMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, LibraryEntry):
      return {
        LibraryEntry.SERVER_ID_PARAM : obj.getServerId(),
        LibraryEntry.HOST_ID_PARAM : obj.getHostId(),
        LibraryEntry.SONG_PARAM : obj.getSong(),
        LibraryEntry.ARTIST_PARAM : obj.getArtist(),
        LibraryEntry.ALBUM_PARAM : obj.getAlbum(),
        LibraryEntry.IS_DELETED_PARAM : obj.getDeleteStatusString(),
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Server / webserver / LibraryMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, LibraryEntry):
      return {
        LibraryEntry.SERVER_ID_PARAM : obj.getServerId(),
        LibraryEntry.HOST_ID_PARAM : obj.getHostId(),
        LibraryEntry.SONG_PARAM : obj.getSong(),
        LibraryEntry.ARTIST_PARAM : obj.getArtist(),
        LibraryEntry.ALBUM_PARAM : obj.getAlbum(),
        LibraryEntry.IS_DELETED_PARAM : obj.getDeleteStatusString(),
      }
    else:
      return json.JSONEncoder.default(self, obj)
github klnusbaum / UDJ-Server / webserver / LibraryMethods.py View on Github external
def getJSONObject(dbrow):
  return LibraryEntry(
    dbrow.id, 
    dbrow.hostId, 
    dbrow.song, 
    dbrow.artist, 
    dbrow.album, 
    dbrow.isDeleted)
github klnusbaum / UDJ-Android-Client / webserver / LibraryMethods.py View on Github external
def addSongToLibrary(to_add, db):
  idreturn = db.insert('library', 
    song=to_add['song'],
    artist=to_add['artist'],
    album=to_add['album'],
    hostId=to_add['host_lib_song_id'])
  toReturn = db.select(
    'library', 
    where=web.db.sqlwhere({'id' : idreturn})
  )
  row = toReturn[0]
  return LibraryEntry(row.id, row.hostId, row.song, row.artist, row.album, row.isDeleted)
github klnusbaum / UDJ-Android-Client / webserver / LibraryMethods.py View on Github external
def default(self, obj):
    if isinstance(obj, LibraryEntry):
      return {
        LibraryEntry.SERVER_ID_PARAM : obj.getServerId(),
        LibraryEntry.HOST_ID_PARAM : obj.getHostId(),
        LibraryEntry.SONG_PARAM : obj.getSong(),
        LibraryEntry.ARTIST_PARAM : obj.getArtist(),
        LibraryEntry.ALBUM_PARAM : obj.getAlbum(),
        LibraryEntry.IS_DELETED_PARAM : obj.getDeleteStatusString(),
      }
    else:
      return json.JSONEncoder.default(self, obj)