Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

1 total

On This Page:

  1. 1 Django Q objects

Django Q objects

// description of your code here

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)

1 total

On This Page:

  1. 1 Django Q objects