Beispiel #1
0
def search_movies(search_text, page, size):
    movie_repo = MovieRepository(get_db())
    if search_text is None:
        movies = movie_repo.find_all(page, size)
    else:
        movies = movie_repo.find_by_keyword(search_text, page, size)

    return jsonify(movies)
Beispiel #2
0
def index():
    # todo: grab "featured" movies
    movie_repo = MovieRepository(get_db())
    movies = movie_repo.find_all(1, 10)
    return render_template('home/index.html', movies=movies)