Created
November 3, 2011 10:11
-
-
Save afroisalreadyinu/1336189 to your computer and use it in GitHub Desktop.
Product query examples
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
product = Product(color='red', size='small', weight='light') | |
pq = BasicProductQuery(color='red') | |
assert product in pq | |
assert product not in ~pq | |
SmallAndLight = BasicProductQuery(size='small') & BasicProductQuery(weight='light') | |
assert product in SmallAndLight | |
SmallAndLightOrNotRed = SmallAndLight | ~BasicProductQuery(color='red') | |
product2 = Product(size='big', color='blue', weight='heavy') | |
assert product2 in SmallAndLightOrNotRed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment