Skip to content

Make filters for notes get#24

Open
ArtemBratyashin wants to merge 4 commits into
mainfrom
make_filters_for_notes_get
Open

Make filters for notes get#24
ArtemBratyashin wants to merge 4 commits into
mainfrom
make_filters_for_notes_get

Conversation

@ArtemBratyashin

Copy link
Copy Markdown
Contributor

Изменения

Добавил ручку фильтрации.
Closes #17

Детали реализации

Сделал функцию фильтрации в сервисах, как это сделано в других ручках проекта. Фильтрацию реализовал по аналогии с рентал.

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

@ArtemBratyashin ArtemBratyashin requested a review from petrCher May 25, 2026 18:16
@ArtemBratyashin ArtemBratyashin self-assigned this May 25, 2026
Comment thread modal_backend/utils/services.py Outdated
Comment thread modal_backend/models/db.py Outdated
Comment thread modal_backend/models/db.py Outdated
Comment thread modal_backend/utils/services.py Outdated
@petrCher

Copy link
Copy Markdown
Member

обязательно после исправлений протестируй пожалуйста локально, сам посоздавай данные и посмотри грамотно ли работает, может я что-то случайно не заметил или не учел при ревью

@ArtemBratyashin

Copy link
Copy Markdown
Contributor Author

Проверил все в свагере. Сделал 2 Note и поселектил их через разные группы и сервисы

status: str,
asc_order: bool,
type_id: Optional[int] = None,
limit: int = 100,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

limit и offset не обязательно задавать, так как они все равно придут
только None добавлять надо, так как None не включен в int, str и тд

groups_id: Optional[List[int]] = None,
services_id: Optional[List[int]] = None,
status: Optional[str] = None,
asc_order: Optional[bool] = True,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

тоже не надо

def search_by_status(self, status: Optional[str] = None) -> bool:
if status == "active":
return Note.status == "active"
if status == "archived":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

лучше делать elif, чтобы сократить время на запрос

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.

доделать грамотную фильтрацию в get notes

2 participants