Skip to content

Commit 7da76a5

Browse files
author
Ryan P Kilby
committed
Drop django<1.7 support
1 parent 68efb74 commit 7da76a5

File tree

6 files changed

+8
-51
lines changed

6 files changed

+8
-51
lines changed

.travis.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ python:
66
- "3.4"
77
- "3.5"
88
env:
9-
- DJANGO="Django>=1.4,<1.5"
10-
- DJANGO="Django>=1.5,<1.6"
11-
- DJANGO="Django>=1.6,<1.7"
129
- DJANGO="Django>=1.7,<1.8"
1310
- DJANGO="Django>=1.8,<1.9"
1411
install:
@@ -18,18 +15,6 @@ script: python manage.py test rest_framework_filters
1815

1916
matrix:
2017
exclude:
21-
- python: "3.2"
22-
env: DJANGO="Django>=1.4,<1.5"
23-
- python: "3.3"
24-
env: DJANGO="Django>=1.4,<1.5"
25-
- python: "3.4"
26-
env: DJANGO="Django>=1.4,<1.5"
27-
- python: "3.5"
28-
env: DJANGO="Django>=1.4,<1.5"
29-
- python: "3.5"
30-
env: DJANGO="Django>=1.5,<1.6"
31-
- python: "3.5"
32-
env: DJANGO="Django>=1.6,<1.7"
3318
- python: "3.5"
3419
env: DJANGO="Django>=1.7,<1.8"
3520
fast_finish: true

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Installation
2020
Requirements
2121
------------
2222

23-
* Python 2.6+
24-
* Django 1.5.6+
23+
* Python 2.7+
24+
* Django 1.7.10+
2525
* Django REST framework 3.0+
2626

2727
Usage
@@ -33,10 +33,10 @@ Here's how you were probably doing filtering before:
3333
3434
import django_filters
3535
from myapp.models import Product
36-
36+
3737
class ProductFilter(django_filters.FilterSet):
3838
manufacturer = django_filters.CharFilter(name="manufacturer__name")
39-
39+
4040
class Meta:
4141
model = Product
4242
fields = ['category', 'in_stock', 'manufacturer']
@@ -49,10 +49,10 @@ To use ``django-rest-framework-filters``, simply import ``rest_framework_filters
4949
5050
import rest_framework_filters as filters
5151
from myapp.models import Product
52-
52+
5353
class ProductFilter(filters.FilterSet):
5454
manufacturer = filters.CharFilter(name="manufacturer__name")
55-
55+
5656
class Meta:
5757
model = Product
5858
fields = ['category', 'in_stock', 'manufacturer']

rest_framework_filters/fields.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
from django import forms
22

33

4-
# https://code.djangoproject.com/ticket/19917
5-
class Django14TimeField(forms.TimeField):
6-
input_formats = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
7-
8-
94
class ArrayDecimalField(forms.DecimalField):
105
def clean(self, value):
116
if value is None:

rest_framework_filters/filters.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from collections import OrderedDict
55
from django.utils import six
66

7-
import django
87
from django_filters.filters import *
98

109
from . import fields
@@ -67,11 +66,6 @@ class AllLookupsFilter(Filter):
6766
# Fixed-up versions of some of the default filters
6867
###################################################
6968

70-
class TimeFilter(TimeFilter):
71-
if django.VERSION < (1, 6):
72-
field_class = fields.Django14TimeField
73-
74-
7569
class InSetFilterBase(object):
7670
def filter(self, qs, value):
7771
if value in ([], (), {}, None, ''):

rest_framework_filters/filterset.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
from collections import OrderedDict
55

6-
try:
7-
from django.db.models.constants import LOOKUP_SEP
8-
except ImportError: # pragma: nocover
9-
# Django < 1.5 fallback
10-
from django.db.models.sql.constants import LOOKUP_SEP # noqa
6+
from django.db.models.constants import LOOKUP_SEP
117
from django.db import models
128
try:
139
from django.db.models.related import RelatedObject as ForeignObjectRel
@@ -61,12 +57,6 @@ class FilterSet(six.with_metaclass(FilterSetMetaclass, filterset.FilterSet)):
6157
models.DateTimeField: {
6258
'filter_class': filters.IsoDateTimeFilter,
6359
},
64-
65-
# Django < 1.6 time input formats did not account for microseconds
66-
# https://code.djangoproject.com/ticket/19917
67-
models.TimeField: {
68-
'filter_class': filters.TimeFilter,
69-
},
7060
}
7161

7262
def __init__(self, *args, **kwargs):

rest_framework_filters/tests.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,12 @@
99

1010
import django
1111
from django.db import models
12-
from django.test import TestCase
12+
from django.test import TestCase, override_settings
1313
from django.contrib.auth.models import User
1414

1515
from . import filters
1616
from .filters import RelatedFilter, AllLookupsFilter
1717
from .filterset import FilterSet
18-
from .backends import DjangoFilterBackend
19-
20-
try:
21-
from django.test import override_settings
22-
except ImportError:
23-
# TODO: Remove this once Django 1.6 is EOL.
24-
from django.test.utils import override_settings
2518

2619

2720
class Note(models.Model):

0 commit comments

Comments
 (0)