/ Published in: Django
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
from django.db.models import Q Publisher.objects.filter(Q(state_province="CA") | Q(state_province="AZ")) #or also more programmatically: args = ( Q( title__icontains = 'Foo' ) | Q( title__icontains = 'Bar' ) ) entries = Entry.objects.filter( *args)