Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Khomychh committed Jan 15, 2025
1 parent 94825bc commit 918a45c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ class MovieSession(models.Model):
)

def __str__(self) -> str:
return f"{self.movie} {self.show_time.strftime('%Y-%m-%d %H:%M:%S')}"
date = self.show_time.strftime('%Y-%m-%d %H:%M:%S')
return f"{self.movie} {date}"
2 changes: 1 addition & 1 deletion services/movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def get_movies(
genres_ids: list[int] = None,
actors_ids: list[int] = None
) -> QuerySet | Movie:
) -> QuerySet:
if not genres_ids and not actors_ids:
return Movie.objects.all()
if genres_ids and actors_ids:
Expand Down
6 changes: 3 additions & 3 deletions services/movie_session.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import datetime
from typing import Optional
from xmlrpc.client import DateTime

from django.db.models import QuerySet

from db.models import MovieSession, CinemaHall, Movie


def create_movie_session(
movie_show_time: Optional[DateTime],
movie_show_time: Optional[datetime.datetime],
movie_id: int,
cinema_hall_id: int
) -> MovieSession:
Expand All @@ -32,7 +32,7 @@ def get_movie_session_by_id(movie_session_id: int) -> MovieSession:

def update_movie_session(
session_id: int,
show_time: Optional[DateTime] = None,
show_time: Optional[datetime.datetime] = None,
movie_id: int = None,
cinema_hall_id: int = None
) -> MovieSession:
Expand Down

0 comments on commit 918a45c

Please sign in to comment.