--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABxpZHuPozCVEUFjWFYxipwTyGrY9Syyw-Et%2B_NAqXn6GevNow%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANbmKytQ%3D1hiSQyj5%2Bkj-Dvy2Tk%2B0YUukORMui0cP7BPwXNZdg%40mail.gmail.com.
I will try to explain, although I am not a good teacher.
Suppose you have an 'Example' model that has a 'data' field with 'auto_now_add = True'
And a function 'yesterday()' that returns yesterday, and 'past()' that returns 'yesterday() minus some days'.
if you want to filter items between yesterday() and past(), you could use something like:
Example.objects.filter(data__gte=past(),data__lte=yesterday())
or using .exclude too
If you need more info, you can get better in django docs:
https://docs.djangoproject.com/en/3.1/ref/models/querysets/
I hope I helped a little despite my bad English.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABxpZHsJ9%3DE-cQX4iNQxc8ztP2Hcd%3DC4stZfA3KhMwXrTekxjQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/98702a6a-6341-4495-b879-977e7447c6f8n%40googlegroups.com.