Last active
February 25, 2016 18:03
-
-
Save ikkebr/6d62077fba8dbfd46a84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import __or__ as OR | |
listadeqobjects = [ Q(nome__istartswith="foo"), | |
Q(sobrenome__istartswith="foo"), | |
Q(cidade__istartswith="foo"), | |
Q(descricao__istartswith="foo"), | |
] | |
qs = MeuModelo.objects.filter(reduce(OR, listadeqobjects)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment