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

refactor crud #12

Closed
maxim1770 opened this issue Jan 5, 2023 · 1 comment
Closed

refactor crud #12

maxim1770 opened this issue Jan 5, 2023 · 1 comment
Labels

Comments

@maxim1770
Copy link
Owner

maxim1770 commented Jan 5, 2023

Писать семантику
Там где не нужно .scalar_one_or_none()
писать .scalar(), если значение None по бизнес логике не должно быть
ну а если и будет, то .scalar() вызовет исключение

Так же возможно заменить сравнение с foo_id в filter_by, заменив его на foo (всю модель)

Думать при добавление нового кода, т.к это потом нужно поддерживать
Это больше я про routers api, ну и про некоторые crud .scalars() функции (которые потом нигде возможно не используются)

@maxim1770
Copy link
Owner Author

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant