Skip to content

Instantly share code, notes, and snippets.

@LucasMagnum
Last active August 3, 2017 12:37
Show Gist options
  • Save LucasMagnum/860f3a234c1a805f8b2df8e64b825ef0 to your computer and use it in GitHub Desktop.
Save LucasMagnum/860f3a234c1a805f8b2df8e64b825ef0 to your computer and use it in GitHub Desktop.
Intersection and Bitwise operation AND
# Intersection queryset method
active_adult_products = active_products.intersection(adult_products)
# Bitwise operation using & to get the AND behavior
active_adult_products = active_products & adult_products
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment