-
Notifications
You must be signed in to change notification settings - Fork 729
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
base: master
Are you sure you want to change the base?
solution #410
Conversation
@@ -1,9 +1,32 @@ | |||
from django.db import models | |||
|
|||
|
|||
class Genre(models.Model): |
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.
add str method
cinema/serializers.py
Outdated
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.
Why don't you use model serializers instead?
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.
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
try: | ||
return Genre.objects.get(pk=pk) | ||
except Genre.DoesNotExist: | ||
raise Http404 |
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.
Use get_object_or_404
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.
Good job ☃☃
No description provided.