Changed import statement and reference to GenericRelation in order

to remove the following Django Warning:
site-packages/auditlog/models.py:6: RemovedInDjango19Warning:
  django.contrib.contenttypes.generic is deprecated and will be
  removed in Django 1.9. Its contents have been moved to the
  fields, forms, and admin submodules of
  django.contrib.contenttypes.
    from django.contrib.contenttypes import generic
This commit is contained in:
jay7958 2015-08-20 12:53:59 -05:00
parent 0211d0768f
commit 59fc9eff18

View file

@ -3,7 +3,7 @@ from __future__ import unicode_literals
import json
from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import QuerySet, Q
@ -227,9 +227,9 @@ class LogEntry(models.Model):
return separator.join(substrings)
class AuditlogHistoryField(generic.GenericRelation):
class AuditlogHistoryField(GenericRelation):
"""
A subclass of py:class:`django.contrib.contenttypes.generic.GenericRelation` that sets some default variables. This
A subclass of py:class:`django.contrib.contenttypes.fields.GenericRelation` that sets some default variables. This
makes it easier to access Auditlog's log entries, for example in templates.
By default this field will assume that your primary keys are numeric, simply because this is the most common case.