A
A
Alex Lukyanets2020-12-10 21:44:47
Django
Alex Lukyanets, 2020-12-10 21:44:47

How to make a filter with multiple parameters?

Data can be added to keys, it is necessary to get data for each element of the list, in one request.
Tell me in which direction to google?

keys = ['PHP', 'Bootstrap']
TaggedContentItem.objects.filter(tag__name=keys)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-12-10
@mynameiswisethanyesturday

https://docs.djangoproject.com/en/dev/ref/models/q...

TaggedContentItem.objects.filter(tag__name__in=keys)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question