-
Notifications
You must be signed in to change notification settings - Fork 14
[#H21] Django TG hw #78
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
base: main
Are you sure you want to change the base?
Conversation
Chudopal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не могу пока разрешить мержить это решение, меня немного напугал хардкод в urls
| 'USER': 'admin', | ||
| 'PASSWORD': 'admin', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну все теперь я знаю пароль и могу поломать все приложение)
| path('price_gt=20&price_lt=50/', view=get_filter_products1), | ||
| path('price_gte=20&price_lte=50/', view=get_filter_products2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ой не, это неправильно. Почитай лучше эту статью: https://metanit.com/python/django/3.4.php
|
|
||
|
|
||
| def get_filter_products1(request): | ||
| all_product = Product.objects.filter(cost__gt=20, cost__lt=50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не стоит хардкодить значения, получать их надо прямо из запроса
No description provided.