Get entry by week number using Django ORM?
Posted
by e-satis
on Stack Overflow
See other posts from Stack Overflow
or by e-satis
Published on 2010-03-15T09:43:11Z
Indexed on
2010/03/15
10:09 UTC
Read the original article
Hit count: 573
I tried something like:
MyModel.objects.filter(year__week=1)
It doesn't work. For now, I calculate the first day and the last day of the week and then use gte
and lte
, but it's less than efficient given that SQL comes with a Week
function.
© Stack Overflow or respective owner