def movieJSON(collection_id, movie_id): """ Returns a distinct album in JSON format :param collection_id: Args: movie_id: """ collection = app.Collection().filter_by(id=collection_id).one() movie = app.Movie().filter_by(id=movie_id).one() return jsonify(movie=movie.serialize, collection=collection.serialize)
def movieATOM(collection_id, movie_id): """ Returns a distinct album in Atom format """ collection = app.Collection().filter_by(id=collection_id).one() movie = app.Movie().filter_by(id=movie_id).one() return render_template('movie.xml', movie=movie, collection=collection)
def collectionATOM(collection_id): """ Returns all albums of a distinct collection in Atom format. """ collection = app.Collection().filter_by(id=collection_id).one() movies = app.Movie().filter_by(collection_id=collection_id).all() return render_template('movies.xml', movies=movies, collection=collection)
def collectionJSON(collection_id): """ Returns all movies of a distinct collection in JSON format. :param collection_id: """ movies = app.Movie().filter_by(collection_id=collection_id).all() return jsonify(Movies=[a.serialize for a in movies])