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

Solution #719

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution #719

wants to merge 2 commits into from

Conversation

comnotaDidi
Copy link

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 this project! There are a couple of critical issues that need to be addressed before we can approve the pull request:

  1. CinemaHall Model Issue: The seats_in_row field is currently defined as an ImageField, but it should be an IntegerField to accurately represent the number of seats in each row. This change is essential for correctly calculating the cinema hall's capacity.

  2. MovieSerializer Field Name: In the MovieSerializer, the field name genres should be changed to genre to match the field name in the Movie model. This ensures consistency and prevents potential errors during serialization and deserialization.

Once these issues are resolved, your code will be in great shape! Keep up the excellent work, and don't hesitate 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.

cinema/models.py Outdated
class CinemaHall(models.Model):
name = models.CharField(max_length=255)
rows = models.IntegerField()
seats_in_row = models.ImageField()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The seats_in_row field is incorrectly defined as an ImageField. It should be an IntegerField to represent the number of seats in each row. This is crucial for correctly calculating the capacity property.

many=True,
queryset=Actor.objects.all()
)
genres = serializers.PrimaryKeyRelatedField(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name genres in MovieSerializer should be genre to match the field name in the Movie model. This ensures consistency and prevents potential errors when serializing and deserializing data.

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 addressing the key issues in your code! 🎉 The CinemaHall model now correctly uses IntegerField for seats_in_row, and the Movie model's genre field is properly aligned with the Genre model using ManyToManyField. However, make sure to update the MovieSerializer to use genre instead of genres to maintain consistency and avoid errors.

Your URL configuration and view implementations are well-structured, and the use of routers and ModelViewSet is spot on. Keep up the good work! Remember, addressing the minor issue with the MovieSerializer will enhance your code's robustness. Keep learning and improving! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +23 to +26
genres = serializers.PrimaryKeyRelatedField(
many=True,
queryset=Genre.objects.all()
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name genres should be changed to genre to match the field name in the Movie model. This ensures consistency and prevents potential errors during serialization and deserialization.

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