barseghyanartur / django-mongoengine-filter

django-filter for MongoEngine
https://pypi.org/project/django-mongoengine-filter/
13 stars 7 forks source link

Question: how to do `__in` queries? #11

Closed codekiln closed 3 years ago

codekiln commented 3 years ago

For a document that contains a field with choices:

class UploadJob(Document):
    status = StringField(choices=(("queued", "Queued"), ("in_progress", "In Progress"), ("completed", "Completed"))) 

What is the preferred method of finding UploadJob.objects.filter(status__in=['queued', 'in_progress']) using this library?

Currently, if I submit a QueryDict with ?status='in_progress'&status='queued', it resolves to status[], which is not picked up by Django filter as an __in query.

barseghyanartur commented 3 years ago

You should use MultipleChoiceFilter.