|
17 | 17 | convert_sqlalchemy_relationship, |
18 | 18 | convert_sqlalchemy_hybrid_method) |
19 | 19 | from .registry import Registry, get_global_registry |
20 | | -from .utils import get_query, is_mapped |
| 20 | +from .utils import get_query, is_mapped_class, is_mapped_instance |
21 | 21 |
|
22 | 22 |
|
23 | 23 | def construct_fields(options): |
@@ -117,7 +117,7 @@ def __new__(cls, name, bases, attrs): |
117 | 117 | 'The attribute registry in {}.Meta needs to be an' |
118 | 118 | ' instance of Registry, received "{}".' |
119 | 119 | ).format(name, options.registry) |
120 | | - assert is_mapped(options.model), ( |
| 120 | + assert is_mapped_class(options.model), ( |
121 | 121 | 'You need to pass a valid SQLAlchemy Model in ' |
122 | 122 | '{}.Meta, received "{}".' |
123 | 123 | ).format(name, options.model) |
@@ -146,7 +146,7 @@ class Meta: |
146 | 146 | def is_type_of(cls, root, context, info): |
147 | 147 | if isinstance(root, cls): |
148 | 148 | return True |
149 | | - if not is_mapped(type(root)): |
| 149 | + if not is_mapped_instance(root): |
150 | 150 | raise Exception(( |
151 | 151 | 'Received incompatible instance "{}".' |
152 | 152 | ).format(root)) |
|
0 commit comments