Use a default value for the "embedded" config

This commit is contained in:
Andrew Brookins 2021-10-13 12:58:10 -07:00
parent e59e210834
commit bb08fb9eb5
2 changed files with 2 additions and 1 deletions

View file

@ -834,7 +834,7 @@ class ModelMeta(ModelMetaclass):
# Not an abstract model class or embedded model, so we should let the
# Migrator create indexes for it.
if abc.ABC not in bases and not new_class._meta.embedded:
if abc.ABC not in bases and not getattr(new_class._meta, 'embedded', False):
key = f"{new_class.__module__}.{new_class.__qualname__}"
model_registry[key] = new_class

View file

@ -294,6 +294,7 @@ def test_recursive_query_field_resolution(members):
member1.save()
actual = Member.find(Member.orders.items.name == "Ball").all()
assert actual == [member1]
assert actual[0].orders[0].items[0].name == "Ball"
def test_full_text_search(members):