def filter_queryset(self, attrs, queryset):
        value = attrs[self.field]
        date = attrs[self.date_field]

        filter_kwargs = {}
        filter_kwargs[self.field_name] = value
        filter_kwargs['%s__day' % self.date_field_name] = date.day
        filter_kwargs['%s__month' % self.date_field_name] = date.month
        filter_kwargs['%s__year' % self.date_field_name] = date.year
        return queryset.filter(**filter_kwargs)
dataset/ETHPy150Open tomchristie/django-rest-framework/rest_framework/validators.py/UniqueForDateValidator.filter_queryset/original