From e355b02803e622a87c3b815299f6a259801ccdb9 Mon Sep 17 00:00:00 2001 From: Raffaele Salmaso Date: Sun, 18 Feb 2018 10:20:30 +0100 Subject: [PATCH] Removed python_2_unicode_compatible usage --- src/wiki/models/article.py | 4 ---- src/wiki/models/urlpath.py | 2 -- src/wiki/plugins/attachments/models.py | 3 --- src/wiki/plugins/images/models.py | 3 --- src/wiki/plugins/notifications/models.py | 2 -- 5 files changed, 14 deletions(-) diff --git a/src/wiki/models/article.py b/src/wiki/models/article.py index e8143574..0ec1f715 100644 --- a/src/wiki/models/article.py +++ b/src/wiki/models/article.py @@ -6,7 +6,6 @@ from django.db import models from django.db.models.fields import GenericIPAddressField as IPAddressField from django.db.models.signals import post_save, pre_delete, pre_save from django.utils import translation -from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from mptt.models import MPTTModel @@ -17,7 +16,6 @@ from wiki.core.markdown import article_markdown from wiki.decorators import disable_signal_for_loaddata -@python_2_unicode_compatible class Article(models.Model): objects = managers.ArticleManager() @@ -247,7 +245,6 @@ class Article(models.Model): return reverse('wiki:get', kwargs={'article_id': self.id}) -@python_2_unicode_compatible class ArticleForObject(models.Model): objects = managers.ArticleFkManager() @@ -342,7 +339,6 @@ class BaseRevisionMixin(models.Model): abstract = True -@python_2_unicode_compatible class ArticleRevision(BaseRevisionMixin, models.Model): """This is where main revision data is stored. To make it easier to diff --git a/src/wiki/models/urlpath.py b/src/wiki/models/urlpath.py index 9a4c2f60..ac3650c8 100644 --- a/src/wiki/models/urlpath.py +++ b/src/wiki/models/urlpath.py @@ -9,7 +9,6 @@ from django.core.urlresolvers import reverse from django.db import models, transaction from django.db.models.signals import post_save, pre_delete # Django 1.6 transaction API, required for 1.8+ -from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext from mptt.fields import TreeForeignKey @@ -23,7 +22,6 @@ from wiki.models.article import Article, ArticleForObject, ArticleRevision log = logging.getLogger(__name__) -@python_2_unicode_compatible class URLPath(MPTTModel): """ diff --git a/src/wiki/plugins/attachments/models.py b/src/wiki/plugins/attachments/models.py index aa57afe4..1bd7d8a5 100644 --- a/src/wiki/plugins/attachments/models.py +++ b/src/wiki/plugins/attachments/models.py @@ -3,7 +3,6 @@ import os from django.conf import settings as django_settings from django.db import models from django.db.models import signals -from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext from wiki import managers @@ -20,7 +19,6 @@ class IllegalFileExtension(Exception): pass -@python_2_unicode_compatible class Attachment(ReusablePlugin): objects = managers.ArticleFkManager() @@ -114,7 +112,6 @@ def upload_path(instance, filename): return os.path.join(upload_path, filename) -@python_2_unicode_compatible class AttachmentRevision(BaseRevisionMixin, models.Model): attachment = models.ForeignKey('Attachment', on_delete=models.CASCADE) diff --git a/src/wiki/plugins/images/models.py b/src/wiki/plugins/images/models.py index 24404b44..bdc76d80 100644 --- a/src/wiki/plugins/images/models.py +++ b/src/wiki/plugins/images/models.py @@ -5,7 +5,6 @@ from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models import signals -from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext from wiki.models.pluginbase import RevisionPlugin, RevisionPluginRevision @@ -29,7 +28,6 @@ def upload_path(instance, filename): return os.path.join(upload_path, filename) -@python_2_unicode_compatible class Image(RevisionPlugin): # The plugin system is so awesome that the inheritor doesn't need to do @@ -55,7 +53,6 @@ class Image(RevisionPlugin): return ugettext('Current revision not set!!') -@python_2_unicode_compatible class ImageRevision(RevisionPluginRevision): image = models.ImageField(upload_to=upload_path, diff --git a/src/wiki/plugins/notifications/models.py b/src/wiki/plugins/notifications/models.py index 4b23e353..288c98fd 100644 --- a/src/wiki/plugins/notifications/models.py +++ b/src/wiki/plugins/notifications/models.py @@ -1,7 +1,6 @@ from django.core.urlresolvers import reverse from django.db import models from django.db.models import signals -from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django_nyt.models import Subscription from django_nyt.utils import notify @@ -13,7 +12,6 @@ from wiki.plugins.notifications import settings from wiki.plugins.notifications.util import get_title -@python_2_unicode_compatible class ArticleSubscription(ArticlePlugin): subscription = models.OneToOneField(Subscription, on_delete=models.CASCADE) -- 2.45.2