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 #689

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

Solution #689

wants to merge 2 commits into from

Conversation

pashawarganov
Copy link

No description provided.

class CinemaHall(models.Model):
name = models.CharField(max_length=255)
rows = models.IntegerField()
seats_in_row = models.IntegerField()
Copy link

Choose a reason for hiding this comment

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

You can use models.PositiveIntegerField() for rows and seats :)

Comment on lines 10 to 18
actors = serializers.PrimaryKeyRelatedField(
many=True,
queryset=Actor.objects.all()
)
genres = serializers.PrimaryKeyRelatedField(
many=True,
queryset=Genre.objects.all()
)
duration = serializers.IntegerField()
Copy link

Choose a reason for hiding this comment

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

image

cinema/urls.py Outdated
Comment on lines 1 to 2
from django.urls import path, include
from rest_framework import routers
Copy link

Choose a reason for hiding this comment

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

split different groups of imports

cinema/views.py Outdated
Comment on lines 39 to 40
if serializer.is_valid():
serializer.save()
Copy link

Choose a reason for hiding this comment

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

it's better to use
serializer.is_valid(raise_exception=True)

Copy link

Choose a reason for hiding this comment

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

Fix everywhere

@pashawarganov pashawarganov requested a review from MNDonut October 2, 2024 09:27
Copy link

@LiudmylaKulinchenko LiudmylaKulinchenko left a comment

Choose a reason for hiding this comment

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

Good job 🌼

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.

4 participants