django filter gte and lte on one property of one model

Question:

I have a User model with age property

my models.py

class User(models.Model):
    age = models.IntegerField()

i need to output all users between age 25 and 35

i can only make query which won’t exclude others users

first_query = User.objects.filter(age__gte=25)
second_query = User.objects.filter(age__lte=35)

can i output users between age 25 and 35 and exclude others, in one query?

Asked By: oruchkin

||

Answers: