I've solved it like this.
Thank you for your help.
def get_queryset(self):
context = super(SearchListView, self).get_queryset()
query = self.request.GET.get('q')
selectOptions = self.request.GET.getlist('selectoptions')
argument_list = []
for field in selectOptions:
argument_list.append( Q(**{fiel
Take a look at Q objects:
https://docs.djangoproject.com/en/2.2/topics/db/queries/#complex-lookups-with-q-objects
On Wednesday, July 17, 2019 at 4:04:16 PM UTC-4, 나르엔 wrote:
>
> Hello, I am studying django.
>
> When I use objects.filter, I want to search various columns.
>
> Columns to search fo
Thank you!
That's working! But I think it's just a AND condition. It's embarrassing,
but what should I do with the OR conditions?
def get_queryset(self):
context = super(SearchListView, self).get_queryset()
query = self.request.GET.get('q')
selectOptions = self.request.GET.getlist('selectoptions
Hi.
You can use dictionary unpacking to kwargs.
.filter(**{"name__contains": "foo", "somefield__gt": 123})
ke 17. heinäk. 2019 klo 23.04 나르엔 kirjoitti:
> Hello, I am studying django.
>
> When I use objects.filter, I want to search various columns.
>
> Columns to search for are unknown and ha
Hello, I am studying django.
When I use objects.filter, I want to search various columns.
Columns to search for are unknown and have been receiving columns to search
through checkbox in html.
What should I do? Please teach me.
It's blocked from below.
selectoptions is name in checkbox.
-
5 matches
Mail list logo