|
15 | 15 | convert_sqlalchemy_composite, |
16 | 16 | convert_sqlalchemy_relationship) |
17 | 17 | from .registry import Registry, get_global_registry |
18 | | -from .utils import get_query, is_mapped |
| 18 | +from .utils import get_query, is_mapped_class, is_mapped_instance |
19 | 19 |
|
20 | 20 |
|
21 | 21 | def construct_fields(options): |
@@ -91,7 +91,7 @@ def __new__(cls, name, bases, attrs): |
91 | 91 | 'The attribute registry in {}.Meta needs to be an' |
92 | 92 | ' instance of Registry, received "{}".' |
93 | 93 | ).format(name, options.registry) |
94 | | - assert is_mapped(options.model), ( |
| 94 | + assert is_mapped_class(options.model), ( |
95 | 95 | 'You need to pass a valid SQLAlchemy Model in ' |
96 | 96 | '{}.Meta, received "{}".' |
97 | 97 | ).format(name, options.model) |
@@ -120,7 +120,7 @@ class SQLAlchemyObjectType(six.with_metaclass(SQLAlchemyObjectTypeMeta, ObjectTy |
120 | 120 | def is_type_of(cls, root, context, info): |
121 | 121 | if isinstance(root, cls): |
122 | 122 | return True |
123 | | - if not is_mapped(type(root)): |
| 123 | + if not is_mapped_instance(root): |
124 | 124 | raise Exception(( |
125 | 125 | 'Received incompatible instance "{}".' |
126 | 126 | ).format(root)) |
|
0 commit comments