File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,10 @@ Use an EmbeddedModelField
414414
415415You can use an ``EmbeddedModelField`` to represent a MongoDB ``Object``,
416416which stores a nested document value. This type allows one model to
417- store a separate model in one of its fields. To create an ``EmbeddedModelField``, use
418- the ``EmbeddedModelField()`` class constructor and pass the following arguments:
417+ store a separate model in one of its fields. To create an ``EmbeddedModelField``,
418+ define an embedded model class as a subclass of the ``EmbeddedModel`` abstract model.
419+ Then, create a field in your base model class by using the ``EmbeddedModelField()``
420+ constructor and pass the following arguments:
419421
420422- ``embedded_model``: Specifies the model class to store.
421423
@@ -443,7 +445,7 @@ and modifies the ``Movie`` model to include the ``EmbeddedModelField``:
443445 :end-before: end-embedded-field
444446 :language: python
445447 :copyable:
446- :emphasize-lines: 18
448+ :emphasize-lines: 5, 18
447449
448450.. tip::
449451
You can’t perform that action at this time.
0 commit comments