Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
CheshireKate committed Dec 5, 2024
1 parent 9f1cbe4 commit 403caed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cinema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class Movie(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
duration = models.IntegerField()
actors = models.ManyToManyField(Actor)
genres = models.ManyToManyField(Genre)
actors = models.ManyToManyField(Actor, related_name="movies")
genres = models.ManyToManyField(Genre, related_name="movies")

def __str__(self):
return self.title
2 changes: 1 addition & 1 deletion cinema/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
path("actors/", ActorList.as_view(), name="actor-list"),
path("actors/<int:pk>/", ActorDetail.as_view(), name="actor-detail"),
path("cinemahall/", cinema_hall_list, name="cinema-hall-list"),
path("cinamehall/<int:pk>/",
path("cinemehall/<int:pk>/",
cinema_hall_detail,
name="cinema-hall-detail"),
path("", include(router.urls)),
Expand Down
6 changes: 3 additions & 3 deletions cinema/views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.shortcuts import get_object_or_404

from rest_framework import status, mixins, viewsets
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from rest_framework import status, mixins, viewsets

from django.shortcuts import get_object_or_404
from rest_framework.views import APIView
from rest_framework.viewsets import GenericViewSet

Expand Down

0 comments on commit 403caed

Please sign in to comment.