Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Develop #4

wants to merge 4 commits into from

Conversation

dmytrik
Copy link

@dmytrik dmytrik commented Jan 18, 2025

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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:

  1. Typo in create_movie Function: The variable exciting_movie should be corrected to existing_movie to ensure clarity and functionality when checking for existing movies.

  2. 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.

  3. Parameter Shadowing in Validator: In the check_date_on_the_future validator, the parameter date shadows the date module from datetime. Consider renaming this parameter to something like movie_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.

MovieModel.name == movie.name,
MovieModel.date == movie.date
).first()
if exciting_movie:

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.

Comment on lines +70 to +71
prev_page = f"/theater/movies/?page={page - 1}&per_page={per_page}"
next_page = f"/theater/movies/?page={page + 1}&per_page={per_page}"

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.


@field_validator("date")
@classmethod
def check_date_on_the_future(cls, date: date):

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.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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:

  1. 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.

  2. Parameter Shadowing in Validator: 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.

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! ✨

Comment on lines +70 to +71
prev_page = f"/theater/movies/?page={page - 1}&per_page={per_page}"
next_page = f"/theater/movies/?page={page + 1}&per_page={per_page}"

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):

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants