File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ def __str__(self):
31
31
# end-models
32
32
33
33
# start-filter-project
34
- from sample_mflix .models import Movie
35
-
36
34
movies = Movie .objects .raw_aggregate ([
37
35
{"$match" : {"title" : "The Parent Trap" }},
38
36
{"$project" : {
Original file line number Diff line number Diff line change
1
+ The |model-classes | an inner ``Meta `` class and a ``__str__() `` method.
2
+ To learn about these model features, see :ref: `django-models-define ` in the
3
+ Create Models guide.
4
+
5
+ Run Code Examples
6
+ `````````````````
7
+
8
+ You can use the Python interactive shell to run the code examples.
9
+ To enter the shell, run the following command from your project's
10
+ root directory:
11
+
12
+ .. code-block :: bash
13
+
14
+ python manage.py shell
15
+
16
+ After entering the Python shell, ensure that you import the following models and
17
+ modules:
18
+
19
+ |model-imports |
20
+
21
+ To learn how to create a {+framework+} application that uses the ``Movie ``
22
+ model and the Python interactive shell to interact with MongoDB documents,
23
+ visit the :ref: `django-get-started ` tutorial.
Original file line number Diff line number Diff line change @@ -65,9 +65,19 @@ definitions:
65
65
:language: python
66
66
:copyable:
67
67
68
- To learn how to create a Django application that uses a similar ``Movie``
69
- model to interact with MongoDB documents, visit the :ref:`django-get-started`
70
- tutorial.
68
+ .. include:: /includes/use-sample-data.rst
69
+
70
+ .. replacement:: model-classes
71
+
72
+ ``Movie`` and ``Theater`` models include
73
+
74
+ .. replacement:: model-imports
75
+
76
+ .. code-block:: python
77
+
78
+ from <your application name>.models import Movie, Theater
79
+ from {+framework+}.utils import timezone
80
+ from datetime import datetime
71
81
72
82
.. _django-raw-queries-run:
73
83
You can’t perform that action at this time.
0 commit comments