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
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)
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('/')
def all_movies(): """View all movies.""" # import pdb; pdb.set_trace() movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def show_movies(): movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def all_movies(): """getting all movies""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def movies_page(): """views all movies.""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def get_all_movies(): all_movies = crud.get_movies() return render_template('all_movies.html', movies=all_movies)
def show_all_movies(): """Show all movies""" movies = crud.get_movies() return render_template("movies.html", movies=movies)
def all_movies(): """View all movies.""" movies = crud.get_movies() return render_template("all_movies.html", movies=movies)
def all_movies(): """View movies page.""" movie = crud.get_movies() return render_template('movies.html', movie=movie)
def all_movies(): """Display all movies.""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def movie_list(): """View list of movies""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def all_movies(): """Return a list of all movies""" movies = crud.get_movies() return render_template("all_movies.html", movies=movies)
def display_movies(): """View a list of all movies with links.""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def all_movies(): movies = crud.get_movies() return render_template("all_movies.html", movies=movies)
def movies(): """Show all movies""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)
def show_all_movies(): """Show all movies in database""" movies = crud.get_movies() return render_template('all_movies.html', movies=movies)