Skip to content

Instantly share code, notes, and snippets.

@JorgeMichelena
Created September 19, 2022 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JorgeMichelena/9a0f02c9a9c8f54b111b6bf4361064d8 to your computer and use it in GitHub Desktop.
Save JorgeMichelena/9a0f02c9a9c8f54b111b6bf4361064d8 to your computer and use it in GitHub Desktop.
Q objects example query
from django.db.models import Q
sport_targets = (
Target.objects.filter(
Q(topic=Target.Topics.SPORTS) | Q(title__icontains="sport")
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment