from django.db import models
from django.db.models.lookups import DateTransform


@models.DateTimeField.register_lookup
class WeekTransform(DateTransform):
    lookup_name = 'week'


@models.DateTimeField.register_lookup
class ISOYearTransform(DateTransform):
    lookup_name = 'isoyear'
Django queryset filtering by ISO week number