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" #849

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

Conversation

OleksiukStepan
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 have a few settings files or a folder named "settings". This import searches for real settings

Comment on lines 8 to 10
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.

list/str or None type. Fix annotation everywhere

@@ -15,13 +17,17 @@ def get_movies(
if actors_ids:
queryset = queryset.filter(actors__id__in=actors_ids)

if title:
queryset = queryset.filter(title__contains=title)
Copy link

Choose a reason for hiding this comment

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

I recommend to use "icontains" because when you look for the movie "The Maze Runner" and enter "maze" it should find the movie as well(for user's comfortability)
So:
contains - case-sensitive (when Maze and maze are different words)
icontains - case-insensitive (when both Maze and maze are the same)

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