Skip to content

Commit

Permalink
Merge pull request #13 from beproud/feature/add-support-django22
Browse files Browse the repository at this point in the history
Add django2.2 support and drop django1.8 #12
  • Loading branch information
ae35bp authored Apr 21, 2020
2 parents fb8a9ef + 66a1dbe commit 1e8efd6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ python:
- "2.7"
- "3.6"
env:
- DJANGO="1.8"
- DJANGO="1.11"
- DJANGO="2.2"
script: tox
5 changes: 3 additions & 2 deletions beproud/django/notify/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def get_for_target(self, target):
@six.python_2_unicode_compatible
class Notification(models.Model):
target_content_type = models.ForeignKey(ContentType, verbose_name=_('content type id'),
db_index=True, null=True, blank=True)
db_index=True, null=True, blank=True,
on_delete=models.CASCADE)
target_object_id = models.PositiveIntegerField(_('target id'),
db_index=True, null=True, blank=True)
target = GenericForeignKey('target_content_type', 'target_object_id')
Expand All @@ -56,7 +57,7 @@ class Meta:

@six.python_2_unicode_compatible
class NotifySetting(models.Model):
target_content_type = models.ForeignKey(ContentType, verbose_name=_('content type id'))
target_content_type = models.ForeignKey(ContentType, verbose_name=_('content type id'), on_delete=models.CASCADE)
target_object_id = models.PositiveIntegerField(_('target id'))
target = GenericForeignKey('target_content_type', 'target_object_id')

Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def read_file(filename):

setup(
name='bpnotify',
version='0.46',
version='0.47',
description='Notification routing for Django',
author='BeProud',
author_email='project@beproud.jp',
Expand All @@ -35,13 +35,9 @@ def read_file(filename):
namespace_packages=['beproud', 'beproud.django'],
test_suite='tests.main',
install_requires=[
'Django>=1.8',
'Django>=1.11',
'django-jsonfield>=1.0.1',
'six',
],
tests_require=[
'celery>=4.1',
'mock>=0.7.2',
],
zip_safe=False,
)
13 changes: 7 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py27-django{18,111},py36-django{18,111}
envlist = py27-django{111,22},py36-django{111,22}

[testenv]
basepython =
Expand All @@ -9,21 +9,22 @@ basepython =

deps =
six
django18: Django>=1.8,<1.9
django18: celery>=4.0,<4.1
django111: Django>=1.11,<2.0
django111: celery>=4.0,<4.1
django111: celery>=4.2,<4.3
django22: Django~=2.2.12
django22: celery>=4.2,<4.3
mock>=0.7.2

commands=python setup.py test

[travis]
os =
linux: py{27,36}-django{18,111}
linux: py27-django111, py36-django{111,22}
python =
2.7: py27
3.6: py36

[travis:env]
DJANGO =
1.8: django18
1.11: django111
2.2: django22

0 comments on commit 1e8efd6

Please sign in to comment.