-
Notifications
You must be signed in to change notification settings - Fork 702
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 #741
base: master
Are you sure you want to change the base?
Solution #741
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 task requirements! 🎉 Your code meets the core functionality and aligns well with Django REST Framework practices. There are a few minor improvements suggested, such as ensuring no database files are pushed to the repository and refining the condition for checking actions in viewsets. Keep up the good work, and consider these suggestions for future enhancements. Well done! 👏
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
if self.action == "retrieve": | ||
return MovieDetailSerializer | ||
|
||
return MovieSerializer | ||
|
||
def get_queryset(self): | ||
queryset = super().get_queryset() | ||
if self.action == ("list", "retrieve"): |
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 condition if self.action == ("list", "retrieve"):
is incorrect. The self.action
attribute is a string, so it should be compared to a single string value, not a tuple. Consider using if self.action in ["list", "retrieve"]:
to check if the action is either 'list' or 'retrieve'.
No description provided.