# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, print_function, division,
                        absolute_import)


import django_filters


class QuerySetMethodFilter(django_filters.Filter):

    def __init__(self, *args, **kwargs):
        self.method = kwargs.pop('method')
        self.method_args = kwargs.pop('method_args', [])
        self.method_kwargs = kwargs.pop('method_kwargs', {})
        super(QuerySetMethodFilter, self).__init__(*args, **kwargs)

    def filter(self, qs, value):
        args = [value] + self.method_args
        kwargs = self.method_kwargs
        return getattr(qs, self.method)(*args, **kwargs)


class SearchFilter(QuerySetMethodFilter):

    def __init__(self, *args, **kwargs):
        kwargs['method'] = 'search'
        super(SearchFilter, self).__init__(*args, **kwargs)

@@ -127,16 +127,190 @@
 mport)%0A%0A
+from datetime import datetime%0A%0Afrom django import forms%0Afrom django.conf import settings%0Afrom django.utils import timezone%0Afrom django.core.exceptions import ValidationError%0A
 %0Aimport 
@@ -979,28 +979,748 @@
 ).__init__(*args, **kwargs)%0A
+%0A%0Aclass UtcDateTimeField(forms.DateTimeField):%0A%0A    def to_python(self, value):%0A        if not value:%0A            return None%0A        if isinstance(value, datetime):%0A            return value%0A        try:%0A            if value.endswith('Z'):%0A                value = value%5B:-1%5D%0A            o = datetime.strptime(value, '%25Y-%25m-%25dT%25H:%25M:%25S')%0A            o = timezone.make_aware(o, timezone.utc)%0A            if not getattr(settings, 'USE_TZ', False):%0A                o = timezone.make_naive(o, timezone.get_default_timezone())%0A            return o%0A        except ValueError:%0A            raise ValidationError(self.error_messages%5B'invalid'%5D)%0A%0A%0Aclass UtcDateTimeFilter(django_filters.Filter):%0A    field_class = UtcDateTimeField%0A

Add UTC datetime filter