@@ -116,8 +116,6 @@ of ``141``:
116
116
117
117
.. code-block:: python
118
118
119
- from sample_mflix.models import Movie
120
-
121
119
movie = Movie.objects.create(title="Poor Things", runtime=141)
122
120
123
121
.. note::
@@ -153,10 +151,6 @@ returns ``Movie`` objects that represent movies released on January 1, 2000:
153
151
.. input::
154
152
:language: python
155
153
156
- from sample_mflix.models import Movie
157
- from django.utils import timezone
158
- from datetime import datetime
159
-
160
154
Movie.objects.filter(released=timezone.make_aware(datetime(2000, 1, 1)))
161
155
162
156
.. output::
@@ -180,8 +174,6 @@ retrieves a document in which the ``title`` value is ``"Boyhood"``:
180
174
.. input::
181
175
:language: python
182
176
183
- from sample_mflix.models import Movie
184
-
185
177
Movie.objects.get(title="Boyhood")
186
178
187
179
.. output::
@@ -221,8 +213,6 @@ a document that has a ``title`` value of ``"High Fidelity"`` and adds a
221
213
.. input::
222
214
:language: python
223
215
224
- from sample_mflix.models import Movie
225
-
226
216
Movie.objects.filter(title="High Fidelity").update(plot=
227
217
"Rob, a record store owner and compulsive list maker, recounts his top five breakups, including the one in progress.")
228
218
@@ -256,8 +246,6 @@ and deletes documents that have a ``runtime`` value of ``5``:
256
246
.. input::
257
247
:language: python
258
248
259
- from sample_mflix.models import Movie
260
-
261
249
Movie.objects.filter(runtime=5).delete()
262
250
263
251
.. output::
0 commit comments