Skip to content

Commit 412abb6

Browse files
committed
jib feedback
1 parent 4fbefe4 commit 412abb6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

source/includes/model-data/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ def __str__(self):
5858

5959
# start-embedded-field
6060
from django.db import models
61+
from django_mongodb_backend.models import EmbeddedModel
6162
from django_mongodb_backend.fields import EmbeddedModelField
6263

63-
class Award(models.Model):
64+
class Award(EmbeddedModel):
6465
wins = models.IntegerField(default=0)
6566
nominations = models.IntegerField(default=0)
6667
text = models.CharField(max_length=100)

source/model-data/models.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ The following table describes supported BSON field types and their
171171
with {+django-odm+}, see the :ref:`django-models-embedded` section in this guide.
172172

173173
* - ``ObjectId``
174-
- ``ObjectIdAutoField``
174+
- ``ObjectIdField``
175175
- | Stores unique 12-byte identifiers that MongoDB uses as primary keys.
176176

177177
* - ``Binary``
@@ -216,7 +216,7 @@ To create an model that represents a MongoDB collection, add your model
216216
class definitions to your application's ``models.py`` file. In your model
217217
class, specify the fields you want to store and include any model metadata
218218
in an inner ``Meta`` class. You can also use the ``__str__()`` method to
219-
define a string representation of your model. Use the following syntax to
219+
define the string representation of your model. Use the following syntax to
220220
define a model:
221221

222222
.. code-block:: python
@@ -226,11 +226,11 @@ define a model:
226226
<field name> = <data type>
227227
# Include additional fields here
228228

229-
class Meta:
230-
# Include metadata here
229+
class Meta:
230+
# Include metadata here
231231

232-
def __str__(self):
233-
# Include logic for displaying your model as a string here
232+
def __str__(self):
233+
# Include logic for displaying your model as a string here
234234

235235
To use your models, you must add them to your project's
236236
``settings.py`` file. Edit the ``INSTALLED_APPS`` value to include

0 commit comments

Comments
 (0)