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

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

Solution #331

wants to merge 7 commits into from

Conversation

Munkoor
Copy link

@Munkoor Munkoor commented Sep 6, 2023

No description provided.

migrations.CreateModel(
name='CinemaHall',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),

Choose a reason for hiding this comment

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

change ' to ", you can use Black

cinema/views.py Outdated
serializer = MovieSerializer(movie, data=request.data)
def put(self, request, pk):
genre = self.get_object(pk)
serializer = GenreSerializer(genre, data=request.data)
if serializer.is_valid():

Choose a reason for hiding this comment

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

serializer.is_valid(raise_exception=True) use it instead of if serializer.is_valid():

Copy link

Choose a reason for hiding this comment

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

do it

cinema/views.py Outdated
MovieSerializer,
GenreSerializer,
ActorSerializer,
CinemaHallSerializer)

Choose a reason for hiding this comment

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

Suggested change
CinemaHallSerializer)
CinemaHallSerializer
)

@Munkoor Munkoor requested a review from vasylhnatiuk September 6, 2023 13:20
cinema/urls.py Outdated
Comment on lines 5 to 11
from cinema.views import (MovieViewSet,
GenreList,
GenreDetail,
ActorList,
ActorDetail,
CinemaHallViewSet
)
Copy link

Choose a reason for hiding this comment

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

bad formmating here (

cinema/urls.py Outdated
Comment on lines 5 to 11
from cinema.views import (MovieViewSet,
GenreList,
GenreDetail,
ActorList,
ActorDetail,
CinemaHallViewSet
)
Copy link

Choose a reason for hiding this comment

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

fix everywhere
you can use black

Suggested change
from cinema.views import (MovieViewSet,
GenreList,
GenreDetail,
ActorList,
ActorDetail,
CinemaHallViewSet
)
from cinema.views import (
MovieViewSet,
GenreList,
GenreDetail,
ActorList,
ActorDetail,
CinemaHallViewSet
)

cinema/views.py Outdated
Comment on lines 70 to 72
class ActorDetail(mixins.RetrieveModelMixin, mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView):
Copy link

Choose a reason for hiding this comment

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

bad formmating here (

cinema/views.py Outdated
serializer = MovieSerializer(movie, data=request.data)
def put(self, request, pk):
genre = self.get_object(pk)
serializer = GenreSerializer(genre, data=request.data)
if serializer.is_valid():
Copy link

Choose a reason for hiding this comment

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

do it

@Munkoor Munkoor requested a review from vsmutok September 12, 2023 10:33
Comment on lines 24 to 25
if serializer.is_valid():
serializer.save()

Choose a reason for hiding this comment

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

replace with serializer.is_valid(raise_exception=True) here as well

Choose a reason for hiding this comment

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

do it

Copy link
Author

Choose a reason for hiding this comment

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

Тоді падає тест test_post_genres

@Munkoor Munkoor requested a review from Yurnerroo October 2, 2023 12:49
Comment on lines 24 to 25
if serializer.is_valid():
serializer.save()

Choose a reason for hiding this comment

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

do it

@Munkoor Munkoor requested a review from vasylhnatiuk October 12, 2023 21:40
cinema/urls.py Outdated

urlpatterns = [
path("movies/", movie_list, name="movie-list"),
path("movies/<int:pk>/", movie_detail, name="movie-detail"),
path("", include(router.urls)),

Choose a reason for hiding this comment

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

No need to include if basepath is not provided. Instead use:
urlpatterns = [list of urls] + router.urls

cinema/urls.py Outdated
path("actors/", ActorList.as_view(), name="actor-list"),
path("actors/<int:pk>/", ActorDetail.as_view(), name="actor-detail"),

path("", include(router.urls)),
Copy link

Choose a reason for hiding this comment

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

No need to include if basepath is not provided. Instead use:
urlpatterns = [list of urls] + router.urls

@Munkoor Munkoor requested a review from vsmutok October 15, 2023 10:54
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.

5 participants