-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #4
base: main
Are you sure you want to change the base?
Develop #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your hard work on the Movie Theater API project! 🎬 Your implementation is well-structured and mostly aligns with the task requirements. However, there are a few critical issues that need to be addressed before we can approve the pull request:
-
Typo in
create_movie
Function: The variableexciting_movie
should be corrected toexisting_movie
to ensure clarity and functionality when checking for existing movies. -
Inconsistent Pagination URLs: The pagination URLs in the
get_movies
function should be updated from/theater/movies/
to/movies/
to match the defined route and ensure consistency. -
Parameter Shadowing in Validator: In the
check_date_on_the_future
validator, the parameterdate
shadows thedate
module fromdatetime
. Consider renaming this parameter to something likemovie_date
to avoid potential conflicts.
Once these issues are resolved, your code will be in great shape! Keep up the excellent work, and feel free to reach out if you have any questions or need further assistance. 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
src/routes/movies.py
Outdated
MovieModel.name == movie.name, | ||
MovieModel.date == movie.date | ||
).first() | ||
if exciting_movie: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo here: exciting_movie
should be existing_movie
to correctly convey the meaning of checking if a movie already exists.
prev_page = f"/theater/movies/?page={page - 1}&per_page={per_page}" | ||
next_page = f"/theater/movies/?page={page + 1}&per_page={per_page}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pagination URLs should match the route defined for movies. Change /theater/movies/
to /movies/
to ensure consistency and correctness.
src/schemas/movies.py
Outdated
|
||
@field_validator("date") | ||
@classmethod | ||
def check_date_on_the_future(cls, date: date): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter date
in the check_date_on_the_future
method shadows the date
module imported from datetime
. Consider renaming this parameter to avoid conflicts, such as movie_date
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the movie routes in the FastAPI application! 🎉 Your code is mostly correct, but there are a few critical issues that need attention:
-
Inconsistent Pagination URLs: Ensure that the pagination URLs in the
get_movies
function are updated to/movies/
instead of/theater/movies/
to match the defined route and maintain consistency. -
Parameter Shadowing in Validator: The parameter
movie_date
in theparse_and_validate_date
validator shadows thedate
module fromdatetime
. Consider renaming this parameter to something likeinput_date
to avoid potential conflicts.
These issues are important for the functionality and clarity of your code. Please review the comments and address these points to improve your code. This decision is made to help you move forward with your learning. Keep up the good work and continue to refine your skills! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
prev_page = f"/theater/movies/?page={page - 1}&per_page={per_page}" | ||
next_page = f"/theater/movies/?page={page + 1}&per_page={per_page}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pagination URLs should be updated to /movies/
instead of /theater/movies/
to match the defined route and ensure consistency.
languages: list[str] | ||
|
||
@field_validator("date") | ||
def parse_and_validate_date(cls, movie_date: str | date): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter movie_date
in the parse_and_validate_date
validator shadows the date
module from datetime
. Consider renaming this parameter to something like input_date
to avoid potential conflicts.
No description provided.