Merge pull request #101 from a1tus/master
Refactored import from generic module to get rid of DeprecationWarning in Django 1.8+
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from django import VERSION
|
from django import VERSION
|
||||||
from django.contrib.contenttypes.generic import (GenericStackedInline,
|
|
||||||
GenericTabularInline)
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
@@ -16,6 +14,11 @@ from django.contrib.admin.options import InlineModelAdmin
|
|||||||
|
|
||||||
if VERSION >= (1, 8):
|
if VERSION >= (1, 8):
|
||||||
from django.contrib.auth import get_permission_codename
|
from django.contrib.auth import get_permission_codename
|
||||||
|
from django.contrib.contenttypes.admin import (GenericStackedInline,
|
||||||
|
GenericTabularInline)
|
||||||
|
else:
|
||||||
|
from django.contrib.contenttypes.generic import (GenericStackedInline,
|
||||||
|
GenericTabularInline)
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
|||||||
Reference in New Issue
Block a user