From cd27b5e4266d2da06de2364beb31167b855e2355 Mon Sep 17 00:00:00 2001 From: Jann Kleen Date: Sat, 29 Aug 2015 00:21:37 +0300 Subject: [PATCH] fix circular import --- remodel/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remodel/registry.py b/remodel/registry.py index 7f41b4c..99f300c 100644 --- a/remodel/registry.py +++ b/remodel/registry.py @@ -1,7 +1,6 @@ from collections import defaultdict from .errors import AlreadyRegisteredError -import remodel.models class ModelRegistry(object): @@ -12,6 +11,8 @@ def __len__(self): return len(self._data) def register(self, name, cls): + import remodel.models + if name in self._data: raise AlreadyRegisteredError('Model "%s" has been already registered' % name) if not issubclass(cls, remodel.models.Model):