diff --git a/src/watson/management/commands/buildwatson.py b/src/watson/management/commands/buildwatson.py index 33b0238..e6e06a4 100644 --- a/src/watson/management/commands/buildwatson.py +++ b/src/watson/management/commands/buildwatson.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals, print_function from optparse import make_option from django.core.management.base import BaseCommand, CommandError -from django.db.models import get_model +from django.apps import apps from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.db import transaction @@ -83,7 +83,7 @@ class Command(BaseCommand): models = [] for model_name in args: try: - model = get_model(*model_name.split(".")) # app label, model name + model = apps.get_model(*model_name.split(".")) # app label, model name except TypeError: # were we given only model name without app_name? registered_models = search_engine.get_registered_models() matching_models = [x for x in registered_models if x.__name__ == model_name]