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

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

solution #410

wants to merge 4 commits into from

Conversation

roffi37
Copy link

@roffi37 roffi37 commented Nov 29, 2023

No description provided.

@@ -1,9 +1,32 @@
from django.db import models


class Genre(models.Model):

Choose a reason for hiding this comment

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

add str method

Choose a reason for hiding this comment

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

Why don't you use model serializers instead?

Copy link
Author

Choose a reason for hiding this comment

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

How should i know about model serializers at that moment if in video and theory about this theme, said nothing about that?

cinema/views.py Outdated
Comment on lines 31 to 34
try:
return Genre.objects.get(pk=pk)
except Genre.DoesNotExist:
raise Http404

Choose a reason for hiding this comment

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

Use get_object_or_404

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.

3 participants