Beispiel #1
0
def read_movies(skip: Optional[int] = 0,
                limit: Optional[int] = 100,
                db: Session = Depends(get_db)):
    # read items from database
    movies = crud.get_movies(db, skip=skip, limit=limit)
    # return them as json
    return movies
Beispiel #2
0
def all_movies():
    """View all movies"""

    all_movies = crud.get_movies()
    
    return render_template('all_movies.html',
                            all_movies= all_movies)
def all_movies():
    """View all movies."""

    movies = crud.get_movies()

    return render_template(
        'all_movies.html', jinja_movies=movies
    )  # we changed movies_jinja from movies (in solution)
Beispiel #4
0
def movies():

    movie_list = []
    for movie in crud.get_movies():
        movie_list.append({
            'movie_id': movie.movie_id,
            'title': movie.title,
            'overview': movie.overview,
            'release_date': movie.release_date,
            'poster_path': movie.poster_path
        })
    return jsonify({'movies': movie_list})
def check_user():

    email = request.form.get('email')
    password = request.form.get('password')

    user = crud.get_user_by_email(email)
    movies = crud.get_movies()

    if user:
        if password == user.password:
            session['user_id'] = user.user_id
            flash(f"You have been successfully logged in!")
            return render_template('loginpage.html', user=user, movies=movies)
        else:
            flash(f"Wrong password. It should be: {user.password}.")
            return redirect('/')
    else:
        flash("Wrong email. Try again")
        return redirect('/')
Beispiel #6
0
def all_movies():
    """View all movies."""
    # import pdb; pdb.set_trace()
    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #7
0
def show_movies():
    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #8
0
def all_movies():    
    """getting all movies"""

    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #9
0
def movies_page():
    """views all movies."""

    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #10
0
def get_all_movies():

    all_movies = crud.get_movies()
    return render_template('all_movies.html', movies=all_movies)
Beispiel #11
0
def show_all_movies():
    """Show all movies"""

    movies = crud.get_movies()

    return render_template("movies.html", movies=movies)
Beispiel #12
0
def all_movies():
    """View all movies."""

    movies = crud.get_movies()

    return render_template("all_movies.html", movies=movies)
Beispiel #13
0
def all_movies():
    """View movies page."""

    movie = crud.get_movies()

    return render_template('movies.html', movie=movie)
Beispiel #14
0
def all_movies():
    """Display all movies."""

    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #15
0
def movie_list():
    """View list of movies"""

    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #16
0
def all_movies():
    """Return a list of all movies"""

    movies = crud.get_movies()

    return render_template("all_movies.html", movies=movies)
Beispiel #17
0
def display_movies():
    """View a list of all movies with links."""

    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #18
0
def all_movies():
    movies = crud.get_movies()

    return render_template("all_movies.html", movies=movies)
Beispiel #19
0
def movies():
    """Show all movies"""

    movies = crud.get_movies()

    return render_template('all_movies.html', movies=movies)
Beispiel #20
0
def show_all_movies():
    """Show all movies in database"""

    movies = crud.get_movies()

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