Django 1.10: Use new app discovery system.

'django.db.models.loading' is removed due to which both
'django.db.models.get_app' and 'django.db.models.get_models' are removed.

See https://docs.djangoproject.com/en/1.10/releases/1.9/#features-removed-in-1-9
This commit is contained in:
Umair Khan 2016-11-22 15:27:47 +05:00 committed by Tim Abbott
parent c8fa25ab88
commit 671c45524b
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ from __future__ import absolute_import
from typing import Any
from django.core.management.base import BaseCommand
from django.db.models import get_app, get_models
from django.apps import apps
from django.contrib.auth.management import create_permissions
class Command(BaseCommand):
@ -12,4 +12,4 @@ class Command(BaseCommand):
def handle(self, *args, **options):
# type: (*Any, **Any) -> None
# From http://stackoverflow.com/a/11914435/90777
create_permissions(get_app("zerver"), get_models(), 2)
create_permissions(apps.get_app_config("zerver"), apps.get_models(), 2)