Django queryset filtering by ISO week number
I have a model that contains datefield . I'm trying to get query set of that model that contains current week (starts on Monday). So since Django datefield contains simple datetime.date model I assumed to filter by using .isocalendar() . Logically it's exactly what I want without no extra comparisons and calculations by current week day. So what I want to do essentially is force .filter statement to behave in this logic: if model.date.isocalendar()[2] == datetime.date.today().isocalendar()[2] ... Yet how to write it inside filter statement? .filter(model__date__isocalendar=datetime.date.today(