From d65f80980710771d4dce413b42d3c062c1ec55b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Thu, 6 Aug 2015 00:51:44 +0200 Subject: [PATCH] fix for Django 1.9: import get_model --- smart_selects/form_fields.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smart_selects/form_fields.py b/smart_selects/form_fields.py index aab42d7..78e4504 100644 --- a/smart_selects/form_fields.py +++ b/smart_selects/form_fields.py @@ -1,4 +1,8 @@ -from django.db.models import get_model +try: + from django.apps import apps + get_model = apps.get_model +except ImportError: + from django.db.models.loading import get_model from django.forms.models import ModelChoiceField from django.forms import ChoiceField