You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move all requests about a movie to a database transaction
@router.post("/movie/ratings/average/", response_model=schemas.AverageRating)defget_average_ratings(movie: schemas.MovieRating, db: Session=Depends(get_db)):
""" Get average movie ratings and number of people who have rated """returncrud.get_movie_average_ratings(db=db, movie=movie)
@router.post("/movie/rating/", response_model=schemas.Rating)defget_ip_rating(spec_rating: schemas.SpecificRating, db: Session=Depends(get_db)):
""" Get Rating of a movie by an ip_address """returncrud.get_rating(db=db, spec_rating=spec_rating)
@router.post("/movie/downloads/", response_model=int)defget_downloads(movie: schemas.MovieRating, db: Session=Depends(get_db)):
""" Gets number of downloads of a movie """returncrud.get_number_of_downloads(db=db, movie=movie)
@router.post("/movie/referrals/", response_model=int)defget_referrals(movie: schemas.MovieRating, db: Session=Depends(get_db)):
""" Gets total number of referrals of a movie """returncrud.get_no_of_referrals(db=db, movie=movie)
All needs to be done when fetching movie data without makeing further requests
The text was updated successfully, but these errors were encountered:
Port to Async modules https://fastapi.tiangolo.com/advanced/async-sql-databases/
Move all requests about a movie to a database transaction
All needs to be done when fetching movie data without makeing further requests
The text was updated successfully, but these errors were encountered: