def show_movie(movie_id):
    """Show details on a particular movie."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template(
        'movie_details.html',
        jinja_movie=movie)  # we changed movies_jinja from movies (in solution)
def show_movie(movie_id):
    """Show detals on a particular movie"""

    movie = crud.get_movie_by_id(movie_id)
    movie_ratings = crud.get_average_rating(movie)

    return render_template('movie_details.html',
                           movie=movie,
                           movie_ratings=movie_ratings)
示例#3
0
def movie_details(movie_id2):
    "Show Movie detail"

    movie_detail = crud.get_movie_by_id(movie_id2)

    # 'movie' on the left is the variable in the .html5
    # This will be dynamically changed based on the movie_detail information returned
    # by the function get_movie_by_id in the crud file
    return render_template('movie_details.html', movie=movie_detail)
def process_rating():

    user_id = session['user_id']
    rating = request.args.get('rating')
    user = crud.get_user_by_id(session['user_id'])
    movie = crud.get_movie_by_id(session['movie_id'])

    #Have rating, need to use Session to track user and movie
    crud.create_rating(user, movie, rating)
    return redirect(f'/users/{user_id}')
示例#5
0
def show_movie(movie_id):
    """Show details for a movie."""

    # next_movie_id = movie_id + 1 #TypeError (str and int)

    # Below: SQLAlchemy equality is True
    movie = crud.get_movie_by_id(movie_id)
    # print("#" * 100)
    # print(movie.movie_id == movie_id) #Python is False

    return render_template("movie_details.html", movie=movie)
示例#6
0
def movie(id):
    """View specific movie"""

    movie = crud.get_movie_by_id(id)

    return jsonify({
        'movie': {
            'movie_id': movie.movie_id,
            'title': movie.title,
            'overview': movie.overview,
            'release_date': movie.release_date,
            'poster_path': movie.poster_path
        }
    })
示例#7
0
def make_movie_rating(movie_id):
	"""Create a new rating."""

	movie = crud.get_movie_by_id(movie_id)
	user_s = session['user']
	score = request.form['score']

	new_rating = crud.create_rating(user_s, movie, score)
	print(new_rating)
	session['rating'] = new_rating

	return redirect('movie_details.html')

	return render_template('movie_details.html', movie=movie)
示例#8
0
def show_movie(movie_id):
    """get movie by id"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template("movie_details.html", movie=movie)
示例#9
0
def display_movie(movie_id):
    """Display a movie."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#10
0
def movie_detail(movie_id):
    """Show individual movie details."""

    movie_details = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie_details)
示例#11
0
def movie_details(movie_id):
    """return movie details"""

    details = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', details=details)
示例#12
0
def show_movie(movie_id):
    movie= crud.get_movie_by_id(movie_id)
    return render_template('movie_details.html'movie=movie)
示例#13
0
def show_movies_by_id(movie_id):
    """Show movie details by ID"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
def show_movie(movie_id):
    """Show details on a particular movie."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#15
0
def movie_detail(movie_id):
    """View movie detail"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_detail.html', movie = movie)
示例#16
0
def movie_details(movie_id):
    """Show details on specific movies"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#17
0
def movie_details(movie_id):
    """View details about one movie"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#18
0
def get_movie(movie_id):
    """ Show a movie's detail """

    movie = crud.get_movie_by_id(movie_id)

    return render_template("movie_details.html", movie=movie)
示例#19
0
def show_movie_info(movie_id):
    """Show movie info page"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#20
0
def show_movie_details(movie_id):
    """Shows details for a movie"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#21
0
def show_movie(movie_id):
    """Show details of a certain movie."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#22
0
def moviedetails(movie_id):
    "Show details."

    movie_details = crud.get_movie_by_id(movie_id)

    return render_template("movie_details.html", movie=movie_details)
示例#23
0
def movie_details(movie_id):
    """View the details page for the movie of the given id."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template("movie_details.html", movie=movie)
示例#24
0
def movie_details(movie_id):
    movie = crud.get_movie_by_id(movie_id)
    return render_template('/movie_details.html', movie=movie)
def show_rating_page(movie_id):
    """Display movie rating page."""
    movie = crud.get_movie_by_id(movie_id)
    session['movie_id'] = movie_id

    return render_template('rate_movie.html', movie=movie)
示例#26
0
def show_movie_details(movie_id):
    """Show more detailed information on a particular movie."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#27
0
def movie_by_id(movie_id):
    """Show movie of a given movie id"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#28
0
def show_movie(movie_id):
    """View movie details."""

    movie = crud.get_movie_by_id(movie_id)

    return render_template('movie_details.html', movie=movie)
示例#29
0
def show_movie_details(movie_id):
    """List details of a particular movie given its movie_id"""

    movie = crud.get_movie_by_id(movie_id)

    return render_template("movie_details.html", movie=movie)