On Wed, 2009-02-25 at 10:41 -0800, Kevin Audleman wrote:
> Ah, gotcha.
>
> Maybe django should include a iin function =)
We already do. It's spelled reduce(operator.or, [...], Q()). :-)
Databases don't support inexact IN matching, so Django doesn't support
it directly. Wrapping what is already
Ah, gotcha.
Maybe django should include a iin function =)
Kevin
On Feb 25, 10:37 am, Alex Gaynor wrote:
> On Wed, Feb 25, 2009 at 1:34 PM, Kevin Audleman
> wrote:
>
>
>
>
>
> > What about the following?
>
> > qset = Q(author__in=[u"Foo", u"Bar"])
>
> > Kevin
>
> > On Feb 25, 10:03 am, Peter B
On Wed, Feb 25, 2009 at 1:34 PM, Kevin Audleman wrote:
>
> What about the following?
>
> qset = Q(author__in=[u"Foo", u"Bar"])
>
>
> Kevin
>
> On Feb 25, 10:03 am, Peter Bengtsson wrote:
> > This works:
> >
> > >>> from django.db.models import Q
> > >>> qset = Q(author__iexact=u"Foo") | Q(autho
What about the following?
qset = Q(author__in=[u"Foo", u"Bar"])
Kevin
On Feb 25, 10:03 am, Peter Bengtsson wrote:
> This works:
>
> >>> from django.db.models import Q
> >>> qset = Q(author__iexact=u"Foo") | Q(author__iexact=u"Bar")
> >>> Books.objects.filter(qset)
>
> But what if the list
On Wed, Feb 25, 2009 at 1:03 PM, Peter Bengtsson wrote:
>
> This works:
>
> >>> from django.db.models import Q
> >>> qset = Q(author__iexact=u"Foo") | Q(author__iexact=u"Bar")
> >>> Books.objects.filter(qset)
>
> But what if the list of things I want to search against is a list.
> E.g.
>
> >>
This works:
>>> from django.db.models import Q
>>> qset = Q(author__iexact=u"Foo") | Q(author__iexact=u"Bar")
>>> Books.objects.filter(qset)
But what if the list of things I want to search against is a list.
E.g.
>>> possible_authors = [u"Foo", u"Bar"]
???
I have a solution but it's very
6 matches
Mail list logo