Skip to content

Commit 51cf72c

Browse files
committed
Fix doc
1 parent ca7a7b3 commit 51cf72c

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

docs/source/ref/models/fields.rst

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,14 @@ These indexes use 0-based indexing.
298298
Querying ``EmbeddedModelArrayField``
299299
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300300

301-
There are a number of custom lookups and a transform for :class:`EmbeddedModelArrayField`, similar to those available for :class:`ArrayField`.
301+
There are a number of custom lookups and a transform for
302+
:class:`EmbeddedModelArrayField`, similar to those available
303+
for :class:`ArrayField`.
302304
We will use the following example model::
303305

304306
from django.db import models
305-
from django_mongodb_backend.fields import EmbeddedModelArrayField, EmbeddedModelField,
307+
from django_mongodb_backend.fields import EmbeddedModelArrayField
308+
306309

307310
class Tag(EmbeddedModel):
308311
label = models.CharField(max_length=100)
@@ -319,7 +322,8 @@ We will use the following example model::
319322
``overlap``
320323
^^^^^^^^^^^
321324

322-
Returns objects where any of the embedded documents in the field match any of the values passed. For example:
325+
Returns objects where any of the embedded documents in the field match any of
326+
the values passed. For example:
323327

324328
.. code-block:: pycon
325329
@@ -342,7 +346,8 @@ Returns objects where any of the embedded documents in the field match any of th
342346
``len``
343347
^^^^^^^
344348

345-
Returns the length of the embedded model array. The lookups available afterward are those available for :class:`~django.db.models.IntegerField`. For example:
349+
Returns the length of the embedded model array. The lookups available afterward
350+
are those available for :class:`~django.db.models.IntegerField`. For example:
346351

347352
.. code-block:: pycon
348353
@@ -359,7 +364,8 @@ Returns the length of the embedded model array. The lookups available afterward
359364
``exact``
360365
^^^^^^^^^
361366

362-
Returns objects where **any** embedded model in the array exactly matches the given value. This acts like an existence filter on matching embedded documents.
367+
Returns objects where **any** embedded model in the array exactly matches the
368+
given value. This acts like an existence filter on matching embedded documents.
363369

364370
.. code-block:: pycon
365371
@@ -371,12 +377,15 @@ Returns objects where **any** embedded model in the array exactly matches the gi
371377
>>> Post.objects.filter(tags__label__exact="tutorial")
372378
<QuerySet [<Post: Second post>]>
373379
374-
Note that this does **not** require the whole array to match, only that at least one embedded document matches exactly.
380+
Note that this does **not** require the whole array to match, only that at
381+
least one embedded document matches exactly.
375382

376383
Keytransforms
377384
^^^^^^^^^^^^^
378385

379-
Key transforms for \:class:`EmbeddedModelArrayField` allow querying fields of the embedded model. The transform checks if **any** element in the array has a field matching the condition, similar to MongoDB behavior. For example:
386+
Key transforms for :class:`EmbeddedModelArrayField` allow querying fields of
387+
the embedded model. The transform checks if **any** element in the array has a
388+
field matching the condition, similar to MongoDB behavior. For example:
380389

381390
.. code-block:: pycon
382391
@@ -392,12 +401,11 @@ Key transforms for \:class:`EmbeddedModelArrayField` allow querying fields of th
392401
>>> Post.objects.filter(tags__label="django")
393402
<QuerySet [<Post: First post>, <Post: Third post>]>
394403
395-
396404
Transforms can be chained:
397405

398406
.. code-block:: pycon
399407
400-
>>> Post.objects.filter(tags__label__icontains="djan")
408+
>>> Post.objects.filter(tags__label__overlap=["django"])
401409
<QuerySet [<Post: First post>, <Post: Third post>]>
402410
403411

docs/source/releases/5.2.x.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ New features
1111
------------
1212

1313
- Added :class:`~.fields.EmbeddedModelArrayField` for storing data as an array
14-
of model instances.
15-
- Added support for ``exact``, ``overlap``, and ``len`` lookups on
16-
:class:`~.fields.EmbeddedModelArrayField`.
14+
of model instances and support. This field supports the ``exact``, ``overlap``, and ``len`` lookups.
1715

1816
Bug fixes
1917
---------

0 commit comments

Comments
 (0)