-
Notifications
You must be signed in to change notification settings - Fork 58
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
solution #12
base: main
Are you sure you want to change the base?
solution #12
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.
Great job on implementing the Movie Theater API endpoints! 🎉 While there are a few minor areas for improvement, such as ensuring consistency in date field types and refining error handling, your code meets the core requirements and functions as expected. Keep up the good work and consider the feedback for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
|
||
db.add(movie) | ||
try: | ||
db.commit() |
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.
Consider adding more specific error handling for database operations, especially for potential IntegrityError exceptions that might arise from constraints other than those already checked.
|
||
db.delete(movie) | ||
db.commit() | ||
return {"detail": "Movie deleted successfully."} |
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.
Returning a JSON response with a detail message is not typical for a 204 No Content response. Consider removing the return statement or changing the status code to 200 if you want to return a message.
name: str = None | ||
date: date = None | ||
score: float = None | ||
overview: str = None | ||
status: MovieStatusEnum = None | ||
budget: float = None | ||
revenue: float = None | ||
country: str = None | ||
genres: List[str] = None | ||
actors: List[str] = None | ||
languages: List[str] = None |
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 MovieCreateOptional
class sets all fields to optional, which might lead to confusion or unintended behavior. Ensure that the application logic properly handles cases where fields are not provided.
class MovieDetailResponseSchema(BaseModel): | ||
name: str | ||
description: Optional[str] = None | ||
release_date: Optional[datetime] = None |
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 release_date
field is of type Optional[datetime]
, which might be inconsistent with the date
field used elsewhere in the schemas. Consider using a consistent type for date fields across different schemas.
No description provided.