Skip to content

Commit

Permalink
Merge pull request #2489 from bagerard/fix_one_to_many_doc
Browse files Browse the repository at this point in the history
Fix one-to-many example that is actually a many to many
  • Loading branch information
bagerard committed Mar 9, 2021
2 parents b045925 + b3ce654 commit 1669f0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/guide/defining-documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,12 @@ as the constructor's argument::
content = StringField()


.. _one-to-many-with-listfields:
.. _many-to-many-with-listfields:

One to Many with ListFields
Many to Many with ListFields
'''''''''''''''''''''''''''

If you are implementing a one to many relationship via a list of references,
If you are implementing a many to many relationship via a list of references,
then the references are stored as DBRefs and to query you need to pass an
instance of the object to the query::

Expand Down
2 changes: 1 addition & 1 deletion mongoengine/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ class ListField(ComplexBaseField):
"""A list field that wraps a standard field, allowing multiple instances
of the field to be used as a list in the database.
If using with ReferenceFields see: :ref:`one-to-many-with-listfields`
If using with ReferenceFields see: :ref:`many-to-many-with-listfields`
.. note::
Required means it cannot be empty - as the default for ListFields is []
Expand Down

0 comments on commit 1669f0c

Please sign in to comment.