diff --git a/django_mongodb/features.py b/django_mongodb/features.py index 55b4c605..644174cf 100644 --- a/django_mongodb/features.py +++ b/django_mongodb/features.py @@ -51,8 +51,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): "mongo_fields.test_listfield.IterableFieldsTests.test_lt", "mongo_fields.test_listfield.IterableFieldsTests.test_lte", "mongo_fields.test_listfield.IterableFieldsTests.test_Q_objects", - # To debug: - "mongo_fields.test_embedded_model.EmbeddedModelFieldTests.test_foreign_key_in_embedded_object", # 'NulledTransform' object has no attribute 'as_mql'. "lookup.tests.LookupTests.test_exact_none_transform", # "Save with update_fields did not affect any rows." diff --git a/django_mongodb/fields/embedded_model.py b/django_mongodb/fields/embedded_model.py index 6fe56811..7568d8ab 100644 --- a/django_mongodb/fields/embedded_model.py +++ b/django_mongodb/fields/embedded_model.py @@ -322,7 +322,7 @@ def get_db_prep_save(self, embedded_instance, connection): # Exclude unset primary keys (e.g. {'id': None}). if field.primary_key and value is None: continue - field_values[field.name] = value + field_values[field.attname] = value # Let untyped fields store model info alongside values. # Use fake RawFields for additional values to avoid passing # embedded_instance to database conversions and to give