问题
is there any way of doing the following
Unicorn.objects.or_filter(magical=True).or_filter(unicorn_length=15).or_filter(skin_color='White').or_filter(skin_color='Blue')
where or_filter
stands for an isolated match
I remember using something similar but cannot find the function anymore!
Help would be great! Thanks :)
回答1:
You're looking for Q objects.
来源:https://stackoverflow.com/questions/2964540/is-there-an-or-filter-django