diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/django-plugins.iml b/.idea/django-plugins.iml
new file mode 100644
index 0000000..1455bdf
--- /dev/null
+++ b/.idea/django-plugins.iml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..82c4887
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..becd76e
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..941eb81
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index b8fd268..6248c21 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,8 @@ reusable.
### Installation
-`django-plugins` is currently tested with Python **2.7**, **3.3**, **3.4**, and
-**3.5** along with Django versions **1.6**-**1.9**. See the [Travis build
+`django-plugins` is currently tested with Python **2.7**, **3.3**, **3.4**, **3.5** and
+**3.10** along with Django versions **1.6**-**4.0**. See the [Travis build
matrix](https://travis-ci.org/krischer/django-plugins) for detailed information
regarding the latest master.
diff --git a/djangoplugins/migrations/0001_initial.py b/djangoplugins/migrations/0001_initial.py
index 0c3aacd..e37654f 100644
--- a/djangoplugins/migrations/0001_initial.py
+++ b/djangoplugins/migrations/0001_initial.py
@@ -38,7 +38,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='plugin',
name='point',
- field=models.ForeignKey(to='djangoplugins.PluginPoint'),
+ field=models.ForeignKey(to='djangoplugins.PluginPoint', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='plugin',
diff --git a/djangoplugins/models.py b/djangoplugins/models.py
index d0fbd94..bc6ba1c 100644
--- a/djangoplugins/models.py
+++ b/djangoplugins/models.py
@@ -2,8 +2,7 @@
from dirtyfields import DirtyFieldsMixin
from django.db import models
-from django.utils.translation import ugettext_lazy as _
-from django.utils.encoding import python_2_unicode_compatible
+from django.utils.translation import gettext_lazy as _
from djangoplugins.signals import django_plugin_enabled, django_plugin_disabled
from .utils import get_plugin_name, get_plugin_from_string
@@ -26,7 +25,6 @@ def get_point(self, point):
return self.get(pythonpath=get_plugin_name(point))
-@python_2_unicode_compatible
class PluginPoint(models.Model):
pythonpath = models.CharField(max_length=255)
title = models.CharField(max_length=255)
@@ -50,7 +48,6 @@ def get_by_natural_key(self, name):
return self.get(pythonpath=name)
-@python_2_unicode_compatible
class Plugin(DirtyFieldsMixin, models.Model):
"""
Database representation of a plugin.
@@ -75,7 +72,7 @@ class Plugin(DirtyFieldsMixin, models.Model):
status
Plugin status.
"""
- point = models.ForeignKey(PluginPoint)
+ point = models.ForeignKey(PluginPoint, on_delete=models.CASCADE)
pythonpath = models.CharField(max_length=255, unique=True)
name = models.CharField(max_length=255, null=True, blank=True)
title = models.CharField(max_length=255, default='', blank=True)
@@ -96,7 +93,7 @@ def __str__(self):
return self.pythonpath
def natural_key(self):
- return (self.pythonpath,)
+ return self.pythonpath,
def is_active(self):
return self.status == ENABLED
diff --git a/djangoplugins/point.py b/djangoplugins/point.py
index 78f036b..cf6feb2 100644
--- a/djangoplugins/point.py
+++ b/djangoplugins/point.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from django import VERSION as django_version
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ObjectDoesNotExist
from django.utils import six
diff --git a/djangoplugins/signals.py b/djangoplugins/signals.py
index df8fc73..b32d9d3 100644
--- a/djangoplugins/signals.py
+++ b/djangoplugins/signals.py
@@ -1,4 +1,4 @@
from django.dispatch import Signal
-django_plugin_disabled = Signal(providing_args=["plugin"])
-django_plugin_enabled = Signal(providing_args=["plugin"])
+django_plugin_disabled = Signal()
+django_plugin_enabled = Signal()
diff --git a/djangoplugins/tests.py b/djangoplugins/tests.py
index f611dc3..20d70b5 100644
--- a/djangoplugins/tests.py
+++ b/djangoplugins/tests.py
@@ -2,7 +2,7 @@
from django import forms
from django.test import TestCase
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from django.utils import six
from .fields import PluginChoiceField, PluginModelChoiceField, \
diff --git a/djangoplugins/utils.py b/djangoplugins/utils.py
index 941a54c..7fccf60 100644
--- a/djangoplugins/utils.py
+++ b/djangoplugins/utils.py
@@ -2,7 +2,7 @@
from django.db import connection
from django.conf import settings
-from django.conf.urls import include, url
+from django.urls import include, re_path as url
from importlib import import_module
diff --git a/setup.py b/setup.py
index 0a73345..97a2245 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ def read_docs(filename):
long_description += read_docs('CHANGES.rst')
setup(name='django-plugins',
- version='0.3.0',
+ version='0.4.0',
author='Lion Krischer',
author_email='lion.krischer@googlemail.com',
packages=find_packages(exclude=['sample-project']),
@@ -55,5 +55,10 @@ def read_docs(filename):
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'Topic :: Software Development :: Libraries :: Python Modules',
])