mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-05-09 22:24:43 +00:00
Fixing buildwatson command for django 1.9
This commit is contained in:
parent
dd306a2821
commit
b9254b1bff
1 changed files with 2 additions and 2 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue