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.