Skip to content

Commit

Permalink
for AI flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
iishchenko committed Oct 17, 2024
1 parent d6279fb commit d57a7bc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
1 change: 0 additions & 1 deletion cinema/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
admin.site.register(Genre)
admin.site.register(CinemaHall)
admin.site.register(Movie)

8 changes: 4 additions & 4 deletions cinema/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
class ActorSerializer(serializers.ModelSerializer):
class Meta:
model = Actor
fields = ['id', 'first_name', 'last_name']
fields = ["id", "first_name", "last_name"]


class GenreSerializer(serializers.ModelSerializer):
class Meta:
model = Genre
fields = ['id', 'name']
fields = ["id", "name"]


class CinemaHallSerializer(serializers.ModelSerializer):
class Meta:
model = CinemaHall
fields = ['id', 'name', 'rows', 'seats_in_row']
fields = ["id", "name", "rows", "seats_in_row"]


class MovieSerializer(serializers.ModelSerializer):
class Meta:
model = Movie
fields = ['id', 'title', 'description', 'duration', 'actors', 'genres']
fields = ["id", "title", "description", "duration", "actors", "genres"]
17 changes: 9 additions & 8 deletions cinema/urls.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import GenreAPIView, ActorListCreateView, ActorDetailView, CinemaHallViewSet, MovieViewSet
from .views import GenreAPIView, \
ActorListCreateView, ActorDetailView, CinemaHallViewSet, MovieViewSet

app_name = 'cinema' # Set the app_name here
app_name = "cinema" # Set the app_name here

router = DefaultRouter()
router.register(r'movies', MovieViewSet)
router.register(r'cinema_halls', CinemaHallViewSet)
router.register(r"movies", MovieViewSet)
router.register(r"cinema_halls", CinemaHallViewSet)

urlpatterns = [
path('genres/', GenreAPIView.as_view(), name='genre-list'),
path('actors/', ActorListCreateView.as_view(), name='actor-list'),
path('actors/<int:pk>/', ActorDetailView.as_view(), name='actor-detail'),
path('', include(router.urls)),
path("genres/", GenreAPIView.as_view(), name="genre-list"),
path("actors/", ActorListCreateView.as_view(), name="actor-list"),
path("actors/<int:pk>/", ActorDetailView.as_view(), name="actor-detail"),
path("", include(router.urls)),
]
6 changes: 4 additions & 2 deletions cinema/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
from rest_framework.views import APIView
from rest_framework import status
from cinema.models import Genre, Actor, CinemaHall, Movie
from cinema.serializers import GenreSerializer, ActorSerializer, CinemaHallSerializer, MovieSerializer
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from cinema.serializers import GenreSerializer, ActorSerializer, \
CinemaHallSerializer, MovieSerializer
from rest_framework.generics import \
ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework import viewsets


Expand Down

0 comments on commit d57a7bc

Please sign in to comment.