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

f #514

Closed
wants to merge 7 commits into from
Closed

f #514

wants to merge 7 commits into from

Conversation

XOctOpus1
Copy link

No description provided.

return queryset


def get_movie_by_id(movie_id: int) -> QuerySet[Movie]:

Choose a reason for hiding this comment

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

It returns one Movie, not queryset

movie_description: str,
genres_ids: list[int] = None,
actors_ids: list[int] = None
) -> QuerySet[Movie]:

Choose a reason for hiding this comment

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

It returns Movie

movie_show_time: datetime.datetime,
movie_id: int,
cinema_hall_id: int
) -> QuerySet[MovieSession]:

Choose a reason for hiding this comment

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

it returns MovieSession

Choose a reason for hiding this comment

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

Please fix in all places

class Migration(migrations.Migration):

dependencies = [
('db', '0001_initial'),

Choose a reason for hiding this comment

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

change ' to ", use Black

Copy link
Author

Choose a reason for hiding this comment

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

but theres no need to change migrations. I thought that its better to let django make migrations

services/movie.py Outdated Show resolved Hide resolved
Co-authored-by: Vasyl Hnatiuk <[email protected]>
db/models.py Outdated
title = models.CharField(max_length=255)
description = models.TextField()
actors = models.ManyToManyField(Actor, related_name="actors")
genres = models.ManyToManyField(Genre, related_name="genres")

Choose a reason for hiding this comment

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

wrong related name

db/models.py Outdated
class Movie(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
actors = models.ManyToManyField(Actor, related_name="actors")

Choose a reason for hiding this comment

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

wrong related name

db/models.py Outdated
class Movie(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
actors = models.ManyToManyField(Actor)

Choose a reason for hiding this comment

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

Suggested change
actors = models.ManyToManyField(Actor)
actors = models.ManyToManyField(Actor, related_name="movies")

db/models.py Outdated
title = models.CharField(max_length=255)
description = models.TextField()
actors = models.ManyToManyField(Actor)
genres = models.ManyToManyField(Genre)

Choose a reason for hiding this comment

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

Suggested change
genres = models.ManyToManyField(Genre)
genres = models.ManyToManyField(Genre, related_name="movies")

Choose a reason for hiding this comment

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

@XOctOpus1 XOctOpus1 closed this Nov 11, 2024
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.

3 participants