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

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

Solution #874

wants to merge 5 commits into from

Conversation

AndriiHamasa
Copy link

No description provided.

db/models.py Outdated
from django.db import models
from django.db.models import UniqueConstraint

import settings
Copy link

Choose a reason for hiding this comment

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

it's better to use
from django.conf import settings
because you may want to have settings folder or another settings file

@@ -6,6 +7,7 @@
def get_movies(
genres_ids: list[int] = None,
actors_ids: list[int] = None,
title: str = None,
Copy link

Choose a reason for hiding this comment

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

str or None. Fix it everywhere

order=order,
row=ticket["row"],
seat=ticket["seat"],
movie_session=movie_session
Copy link

Choose a reason for hiding this comment

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

let's set movie_session_id here

Ticket.objects.bulk_create(ticket_objects)


def get_orders(username: str = None) -> QuerySet:
Copy link

Choose a reason for hiding this comment

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

specify what kind of data this queryset contains. Fix everywhere

if actors_ids:
movie.actors.set(actors_ids)

return movie

Choose a reason for hiding this comment

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

You don't need to return anything in create/update/delete functions, check everywhere

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