I
I
Ilya Korol2019-09-16 13:21:22
Django
Ilya Korol, 2019-09-16 13:21:22

How to display entries for the last entries for the day?

How to get model records sent (field date_send, DateTimeField) for the last 24 hours?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-09-16
@welcome32

SomeModel.objects.filter(date_send__date=date.today())

or
SomeModel.objects.filter(date_send__gte=date.today() - timedelta(days=1))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question