Skip to content

Update #16

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/django-plugins.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion djangoplugins/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 3 additions & 6 deletions djangoplugins/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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.
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion djangoplugins/point.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions djangoplugins/signals.py
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion djangoplugins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
2 changes: 1 addition & 1 deletion djangoplugins/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
packages=find_packages(exclude=['sample-project']),
Expand Down Expand Up @@ -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',
])