Fixed a couple of deprecation warnings
This commit is contained in:
parent
056be4358d
commit
6ab58e3605
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from django.contrib.admin.util import get_fields_from_path, NotRelationField
|
from django.contrib.admin.utils import get_fields_from_path, NotRelationField
|
||||||
from django.core import checks
|
from django.core import checks
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models.fields import FieldDoesNotExist
|
from django.db.models.fields import FieldDoesNotExist
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
from django.apps import apps
|
||||||
|
|
||||||
|
|
||||||
def check_generic_foreign_keys(**kwargs):
|
def check_generic_foreign_keys(**kwargs):
|
||||||
from .generic import GenericForeignKey
|
from .generic import GenericForeignKey
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
fields = (obj
|
fields = (obj
|
||||||
for cls in models.get_models()
|
for cls in apps.get_models()
|
||||||
for obj in six.itervalues(vars(cls))
|
for obj in six.itervalues(vars(cls))
|
||||||
if isinstance(obj, GenericForeignKey))
|
if isinstance(obj, GenericForeignKey))
|
||||||
for field in fields:
|
for field in fields:
|
||||||
|
|
Loading…
Reference in New Issue