@@ -26,7 +26,7 @@ and delete functions on your model objects.
2626
2727 .. code-block:: bash
2828
29- python3 manage.py shell
29+ python manage.py shell
3030
3131 .. step:: Import the required classes and modules
3232
@@ -48,17 +48,14 @@ and delete functions on your model objects.
4848 .. code-block:: python
4949
5050 movie_awards = Award(wins=122, nominations=245, text="Won 1 Oscar")
51- movie = Movie(title="Minari", plot=
52- "A Korean-American family moves to an Arkansas farm in search of their own American Dream",
53- runtime=217, released=timezone.make_aware(datetime(2020, 1, 26, 0, 0)),
54- awards=movie_awards, genres=["Drama", "Comedy"])
55-
56- Save the object to store its data as a document in the ``movies``
57- collection, as shown in the following code:
58-
59- .. code-block:: python
60-
61- movie.save()
51+ movie = Movie.objects.create(
52+ title="Minari",
53+ plot="A Korean-American family moves to an Arkansas farm in search of their own American Dream",
54+ runtime=217,
55+ released=timezone.make_aware(datetime(2020, 1, 26)),
56+ awards=movie_awards,
57+ genres=["Drama", "Comedy"]
58+ )
6259
6360 .. step:: Update your movie object
6461
@@ -79,16 +76,12 @@ and delete functions on your model objects.
7976 a ``Viewer`` object that stores data about a movie viewer named ``"Abigail Carter"``:
8077
8178 .. code-block:: python
82-
83- viewer = Viewer(name="Abigail Carter", email="
[email protected] ",
84- password="secure123")
85-
86- Save the object to store its data as a document in the ``users``
87- collection, as shown in the following code:
8879
89- .. code-block:: python
90-
91- viewer.save()
80+ viewer = Viewer.objects.create(
81+ name="Abigail Carter",
82+ 83+ password="secure123"
84+ )
9285
9386 .. step:: Delete a viewer object
9487
@@ -114,7 +107,7 @@ and delete functions on your model objects.
114107
115108 .. code-block:: bash
116109
117- python3 manage.py runserver
110+ python manage.py runserver
118111
119112 .. step:: Render your new objects
120113
0 commit comments