34👍
✅
Try this;
x = 170
Dataset.objects.filter(i_end_int__gte=x,i_begin_int__lte=x)
where;
gte = greater than equal to
lte = less than equal to
3👍
Dataset.objects.filter(i_begin_int__lte=170, i_end_int__gte=170)
Filter where i_begin_int is less than 170 AND the i_end_int value is greater than 170.
SQL equivalent: SELECT * FROM appname_dataset WHERE i_begin_int <= 170 AND i_end_int >= 170
- [Django]-Using Firebase Auth with Django
- [Django]-Access Python Development Server from External IP
- [Django]-Which Python API should be used with Mongo DB and Django
Source:stackexchange.com