Answer the question
In order to leave comments, you need to log in
How to write a django query?
Hello.
there is a request for a selection of colors, by the name of the product from another model
all_product_colors = Colors.objects.filter(s=all_products.get(product_name=name)).values()
Answer the question
In order to leave comments, you need to log in
> Dictionary
> Regular Expressions
Is this a joke?
all_product_colors = Colors.objects.filter(s=all_products.get(product_name=name)).values()
result = [{k: v for k, v in color.items() if v is True} for color in all_product_colors]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question