Esempio n. 1
0
async def get_movie(item_id: int):
    return crud.get_movie(item_id)
Esempio n. 2
0
def read_movie(movie_id: int, db: Session = Depends(get_db)):
    db_movie = crud.get_movie(db, movie_id=movie_id)
    if db_movie is None:
        raise HTTPException(status_code=404, detail="Movie to read not found")
    return db_movie
Esempio n. 3
0
def all_movies():
    """View all movies."""
    
    movies = crud.get_movie()

    return render_template('all_movies.html', movies=movies)