Answer the question
In order to leave comments, you need to log in
How in Django to filter in view for each value from the list value_list?
Hello, such a problem has appeared, it’s impossible to filter by each value from the value_list list
in the view, I do this:
# отфильтрованные объекты по ид
o_sal = OrderService.objects.all().filter(order_id=order_id)
# list ид
o_sal_t = o_sal.values_list('orderservice_id')
#вот здесь отфильтровать по каждому ид из list
o_sal_ex = OrderServiceExecuter.objects.all().filter(order_service_id__orderservice_id__in=(o_sal_t)).values('executer_id__username')
{% for o_sal_ex in o_sal_ex %}
{{ o_sal_ex }}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question