Skip to content

Commit

Permalink
Dropped support for Django 1.9 and Python 2.7 #139
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Dec 7, 2015
1 parent 09ad54c commit dcc8d8a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 52 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,14 @@ python:
- "3.4"
- "3.3"
- "2.7"
- "2.6"

env:
- DJANGO="django>=1.9,<1.10"
- DJANGO="django>=1.8,<1.9"
- DJANGO="django>=1.7,<1.8"
- DJANGO="django>=1.6,<1.7"

matrix:
exclude:
- python: "2.6"
env: DJANGO="django>=1.7,<1.8"
- python: "2.6"
env: DJANGO="django>=1.8,<1.9"
- python: "2.6"
env: DJANGO="django>=1.9,<1.10"
- python: "3.3"
env: DJANGO="django>=1.9,<1.10"

Expand Down
9 changes: 2 additions & 7 deletions django_hstore/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import django
from django.conf import settings
from django.db.backends.signals import connection_created
from django.apps import AppConfig

from psycopg2.extras import register_hstore

try:
from django.apps import AppConfig
except ImportError: # pragma no cover
AppConfig = object

HSTORE_REGISTER_GLOBALLY = getattr(settings, "DJANGO_HSTORE_ADAPTER_REGISTRATION", "global") == "global"
CONNECTION_CREATED_SIGNAL_WEAKREF = bool(getattr(settings, "DJANGO_HSTORE_ADAPTER_SIGNAL_WEAKREF", False))
Expand Down Expand Up @@ -91,6 +89,3 @@ def ready(self):
connection_created.connect(connection_handler,
weak=CONNECTION_CREATED_SIGNAL_WEAKREF,
dispatch_uid="_connection_create_handler")

if django.get_version() < '1.7':
HStoreConfig().ready()
5 changes: 0 additions & 5 deletions django_hstore/hstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@

if GEODJANGO_INSTALLED:
from django_hstore.managers import HStoreGeoManager # noqa


import django
if django.get_version() < '1.7':
from . import apps # noqa
4 changes: 0 additions & 4 deletions django_hstore/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
import django
from .fields import DictionaryField # noqa


if django.get_version() < '1.7':
from . import apps # noqa
2 changes: 2 additions & 0 deletions django_hstore/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
from django.db.models.sql.subqueries import UpdateQuery
from django.db.models.sql.where import WhereNode
try:
# django <= 1.8
from django.db.models.sql.where import EmptyShortCircuit
except ImportError:
# django >= 1.9
EmptyShortCircuit = Exception
from django.utils import six

Expand Down
8 changes: 4 additions & 4 deletions doc/doc.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Deprecation policy

At any momment of time, *django-hstore* developers will mantain support for three versions of django.

As example: The current stable release of django is 1.8, so django-hstore supports the following django versions: 1.8, 1.7 and 1.6. When
django 1.9 is released, support for 1.6 will be dropped.
As example: The current stable release of django is 1.9, so django-hstore supports the following django versions: 1.9, 1.8 and 1.7. When
django 1.10 is released, support for 1.7 will be dropped.

User Guide
----------
Expand All @@ -110,8 +110,8 @@ This section covers a installing _django-hstore_ and its requirements.
Requirements
^^^^^^^^^^^^

- Python 2.6, 2.7 or 3.3+
- Django 1.6, 1.7 or 1.8
- Python 2.7 or 3.3+
- Django 1.7, 1.8, 1.9
- Psycopg2 2.4.3+
- PostgreSQL 9.0+
Expand Down
35 changes: 11 additions & 24 deletions tests/django_hstore_tests/tests/test_not_transactional.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,14 @@ def setUp(self):
# avoid error "connection already closed"
connection.connect()

if DJANGO_VERSION[:2] >= (1, 6):
def test_hstore_registring_in_transaction_block(self):
obj1 = DataBag.objects.create(name='alpha1', data={'v': '1', 'v2': '3'})
obj2 = DataBag.objects.create(name='alpha2', data={'v': '1', 'v2': '3'})
# Close any existing connection before doing anything
connection.close()
with transaction.atomic():
qs = DataBag.objects.filter(name__in=["alpha2", "alpha1"])
self.assertIsInstance(qs[0].data, HStoreDict)
obj1.delete()
obj2.delete()
connection.close()
else:
def test_hstore_registring_in_transaction_block(self):
obj1 = DataBag.objects.create(name='alpha1', data={'v': '1', 'v2': '3'})
obj2 = DataBag.objects.create(name='alpha2', data={'v': '1', 'v2': '3'})
# Close any existing connection before doing anything
connection.close()
with transaction.commit_on_success():
qs = DataBag.objects.filter(name__in=["alpha2", "alpha1"])
self.assertIsInstance(qs[0].data, HStoreDict)
obj1.delete()
obj2.delete()
connection.close()
def test_hstore_registring_in_transaction_block(self):
obj1 = DataBag.objects.create(name='alpha1', data={'v': '1', 'v2': '3'})
obj2 = DataBag.objects.create(name='alpha2', data={'v': '1', 'v2': '3'})
# Close any existing connection before doing anything
connection.close()
with transaction.atomic():
qs = DataBag.objects.filter(name__in=["alpha2", "alpha1"])
self.assertIsInstance(qs[0].data, HStoreDict)
obj1.delete()
obj2.delete()
connection.close()

0 comments on commit dcc8d8a

Please sign in to comment.