Created
August 2, 2017 14:52
-
-
Save LucasMagnum/6bfc6508e5b79310f3e0351ccdac5176 to your computer and use it in GitHub Desktop.
#DjangoTip - Playing with querysets - Print Queryset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(adult_products.query) | |
""" | |
SELECT `product_product`.`title`, `product_product`.`is_adult`, `product_product`.`is_active` | |
FROM `product_product` WHERE `product_product`.`is_adult` = True | |
""" | |
print(active_products.query) | |
""" | |
SELECT `product_product`.`title`, `product_product`.`is_adult`, `product_product`.`is_active` | |
FROM `product_product` WHERE `product_product`.`is_active` = True | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment