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
414
414
415
415
You can use an ``EmbeddedModelField`` to represent a MongoDB ``Object``,
416
416
which 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:
419
421
420
422
- ``embedded_model``: Specifies the model class to store.
421
423
@@ -443,7 +445,7 @@ and modifies the ``Movie`` model to include the ``EmbeddedModelField``:
443
445
:end-before: end-embedded-field
444
446
:language: python
445
447
:copyable:
446
- :emphasize-lines: 18
448
+ :emphasize-lines: 5, 18
447
449
448
450
.. tip::
449
451
You can’t perform that action at this time.
0 commit comments