def delete_album_by_slug(slug): """ Album deletion can only be done based on slug, thus no conflicts """ album = get_album_by_slug(slug) [x.delete() for x in ContributorAlbum.scan({"slug": condition.EQ(album.slug)})] album.delete()
def get_albums_by_username(username): return [Album.get(calbum.slug) for calbum in ContributorAlbum.scan({"username": condition.EQ(username)})]
def get_album_contributors(album): return [Contributor.get(x.username) for x in ContributorAlbum.scan({"slug": condition.EQ(album.slug)})]
def delete_album_contributor(username, slug): ContributorAlbum.get(username, slug).delete()
def delete_contributor_by_username(username): Contributor.get(username).delete() [x.delete() for x in ContributorAlbum.scan({"username": condition.EQ(username)})]