summaryrefslogtreecommitdiff
path: root/app/lib
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2015-10-22 09:32:21 -0400
committerluxagraf <sng@luxagraf.net>2015-10-22 09:32:21 -0400
commit30ff1913b5983be243286e8891bfb03790dda1d7 (patch)
tree49ce91b2ecb7272626d2a5553ef5110f017a070b /app/lib
parent954830a51fa906c6b16941fd39675c8439ba7351 (diff)
updated my clone of contrib comments to work with django 1.9
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/django_comments/__init__.py2
-rw-r--r--app/lib/django_comments/forms.py2
-rw-r--r--app/lib/django_comments/models.py6
3 files changed, 6 insertions, 4 deletions
diff --git a/app/lib/django_comments/__init__.py b/app/lib/django_comments/__init__.py
index a78b21a..f369ac6 100644
--- a/app/lib/django_comments/__init__.py
+++ b/app/lib/django_comments/__init__.py
@@ -1,7 +1,7 @@
from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import ImproperlyConfigured
-from django.utils.importlib import import_module
+from importlib import import_module
from django_comments.models import Comment
from django_comments.forms import CommentForm
diff --git a/app/lib/django_comments/forms.py b/app/lib/django_comments/forms.py
index 6a3082f..b9249c0 100644
--- a/app/lib/django_comments/forms.py
+++ b/app/lib/django_comments/forms.py
@@ -1,6 +1,6 @@
import time
from django import forms
-from django.forms.util import ErrorDict
+from django.forms.utils import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils.crypto import salted_hmac, constant_time_compare
diff --git a/app/lib/django_comments/models.py b/app/lib/django_comments/models.py
index 08bad3c..78ce8b8 100644
--- a/app/lib/django_comments/models.py
+++ b/app/lib/django_comments/models.py
@@ -1,5 +1,5 @@
from django.conf import settings
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
@@ -24,7 +24,7 @@ class BaseCommentAbstractModel(models.Model):
verbose_name=_('content type'),
related_name="content_type_set_for_%(class)s")
object_pk = models.TextField(_('object ID'))
- content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk")
+ content_object = GenericForeignKey(ct_field="content_type", fk_field="object_pk")
# Metadata about the comment
site = models.ForeignKey(Site)
@@ -79,6 +79,7 @@ class Comment(BaseCommentAbstractModel):
permissions = [("can_moderate", "Can moderate comments")]
verbose_name = _('comment')
verbose_name_plural = _('comments')
+ app_label = _('comment')
def __str__(self):
return "%s: %s..." % (self.name, self.comment[:50])
@@ -190,6 +191,7 @@ class CommentFlag(models.Model):
unique_together = [('user', 'comment', 'flag')]
verbose_name = _('comment flag')
verbose_name_plural = _('comment flags')
+ app_label = _('commentflag')
def __str__(self):
return "%s flag of comment ID %s by %s" % \