Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP -- Django 1.9 and drf 3.3.x support #90

Merged
merged 7 commits into from
Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 8 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,21 @@ services:
python:
- "3.5"
- "3.4"
- "3.3"
- "3.2"
- "2.7"
- "2.6"


env:
- DJANGO="django==1.8.5"
- DJANGO="django==1.7.10"
- DJANGO="django==1.6.11"
- DJANGO="django==1.5.12"
- DJANGO="django==1.8.7"
- DJANGO="django==1.7.11"
- DJANGO="django==1.9"


matrix:
exclude:
- python: "3.5"
env: DJANGO="django==1.7.10"
- python: "3.5"
env: DJANGO="django==1.6.11"
- python: "3.5"
env: DJANGO="django==1.5.12"
- python: "2.6"
env: DJANGO="django==1.7.10"
- python: "2.6"
env: DJANGO="django==1.8.5"
env: DJANGO="django==1.7.11"



branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
psycopg2
djangorestframework>=3.0.4
djangorestframework>=3.3
coverage==3.7.1 # rq.filter: >=3,<4
coveralls
django-filter
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
djangorestframework>=3.0.4,<3.3
djangorestframework>=3.3
24 changes: 0 additions & 24 deletions rest_framework_gis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,3 @@ def get_version():


default_app_config = 'rest_framework_gis.apps.AppConfig'

# maintain support for django 1.5 and 1.6
# TODO: remove in version 1.0
try:
import os
import django

if os.environ.get('DJANGO_SETTINGS_MODULE'):
from django.conf import settings
from .apps import AppConfig

if 'rest_framework_gis' not in settings.INSTALLED_APPS:
import warnings
warnings.simplefilter('always', DeprecationWarning)
warnings.warn('\nGeoModelSerializer is deprecated, '
'add "rest_framework_gis" to settings.INSTALLED_APPS and use '
'"rest_framework.ModelSerializer" instead',
DeprecationWarning)

if django.get_version() < '1.7' or 'rest_framework_gis' not in settings.INSTALLED_APPS:
import rest_framework_gis
AppConfig('rest_framework_gis', rest_framework_gis).ready()
except ImportError:
pass
8 changes: 1 addition & 7 deletions rest_framework_gis/apps.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
try:
from django.apps import AppConfig as BaseConfig
except ImportError: # pragma: nocover
# django <= 1.6
class BaseConfig(object):
def __init__(self, *args):
pass
from django.apps import AppConfig as BaseConfig


class AppConfig(BaseConfig):
Expand Down
6 changes: 1 addition & 5 deletions rest_framework_gis/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
try:
from collections import OrderedDict # noqa
# python 2.6
except ImportError: # pragma: no cover
from ordereddict import OrderedDict # noqa
from collections import OrderedDict # noqa
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def get_install_requires():
'Operating System :: OS Independent',
'Framework :: Django',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
Expand Down
11 changes: 6 additions & 5 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.contrib import admin

admin.autodiscover()


urlpatterns = patterns('',
urlpatterns = [
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

url(r'', include('django_restframework_gis_tests.urls')),

url(r'^static/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'),
)

]