Last active
May 2, 2019 21:49
-
-
Save valerybriz/e3d7c2aa2fe1ec90d5245b18e9a7bda6 to your computer and use it in GitHub Desktop.
example query
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
user_query = User.objects.filter(name="Ana") # Filter the users by the name "Ana" | |
user_query = user_query.filter(age__lte=50) # Then get only the users where the age is less than 50 | |
user_query = user_query.exclude(email__isnull=True) # And exclude the users that doesn't have an email | |
print(user_query) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment