Code

Ticket #12997: 12997-r12842.diff

File 12997-r12842.diff, 5.9 KB (added by ramiro, 4 years ago)

Patch updated wiht some missed methods, updated to r12842 and modified to no remove the title markup.

Line 
1diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
2--- a/docs/ref/models/querysets.txt
3+++ b/docs/ref/models/querysets.txt
4@@ -138,6 +138,8 @@
5 ``filter(**kwargs)``
6 ~~~~~~~~~~~~~~~~~~~~
7 
8+.. method:: filter(**kwargs)
9+
10 Returns a new ``QuerySet`` containing objects that match the given lookup
11 parameters.
12 
13@@ -148,6 +150,8 @@
14 ``exclude(**kwargs)``
15 ~~~~~~~~~~~~~~~~~~~~~
16 
17+.. method:: exclude(**kwargs)
18+
19 Returns a new ``QuerySet`` containing objects that do *not* match the given
20 lookup parameters.
21 
22@@ -181,6 +185,8 @@
23 ``annotate(*args, **kwargs)``
24 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25 
26+.. method:: annotate(*args, **kwargs)
27+
28 .. versionadded:: 1.1
29 
30 Annotates each object in the ``QuerySet`` with the provided list of
31@@ -223,6 +229,8 @@
32 ``order_by(*fields)``
33 ~~~~~~~~~~~~~~~~~~~~~
34 
35+.. method:: order_by(*fields)
36+
37 By default, results returned by a ``QuerySet`` are ordered by the ordering
38 tuple given by the ``ordering`` option in the model's ``Meta``. You can
39 override this on a per-``QuerySet`` basis by using the ``order_by`` method.
40@@ -297,6 +305,8 @@
41 ``reverse()``
42 ~~~~~~~~~~~~~
43 
44+.. method:: reverse()
45+
46 .. versionadded:: 1.0
47 
48 Use the ``reverse()`` method to reverse the order in which a queryset's
49@@ -327,6 +337,8 @@
50 ``distinct()``
51 ~~~~~~~~~~~~~~
52 
53+.. method:: distinct()
54+
55 Returns a new ``QuerySet`` that uses ``SELECT DISTINCT`` in its SQL query. This
56 eliminates duplicate rows from the query results.
57 
58@@ -361,6 +373,8 @@
59 ``values(*fields)``
60 ~~~~~~~~~~~~~~~~~~~
61 
62+.. method:: values(*fields)
63+
64 Returns a ``ValuesQuerySet`` -- a ``QuerySet`` that returns dictionaries when
65 used as an iterable, rather than model-instance objects.
66 
67@@ -444,6 +458,8 @@
68 ``values_list(*fields)``
69 ~~~~~~~~~~~~~~~~~~~~~~~~
70 
71+.. method:: values_list(*fields)
72+
73 .. versionadded:: 1.0
74 
75 This is similar to ``values()`` except that instead of returning dictionaries,
76@@ -472,6 +488,8 @@
77 ``dates(field, kind, order='ASC')``
78 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79 
80+.. method:: dates(field, kind, order='ASC')
81+
82 Returns a ``DateQuerySet`` -- a ``QuerySet`` that evaluates to a list of
83 ``datetime.datetime`` objects representing all available dates of a particular
84 kind within the contents of the ``QuerySet``.
85@@ -506,6 +524,8 @@
86 ``none()``
87 ~~~~~~~~~~
88 
89+.. method:: none()
90+
91 .. versionadded:: 1.0
92 
93 Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to
94@@ -519,7 +539,9 @@
95     []
96 
97 ``all()``
98-~~~~~~~~~~
99+~~~~~~~~~
100+
101+.. method:: all()
102 
103 .. versionadded:: 1.0
104 
105@@ -534,6 +556,8 @@
106 ``select_related()``
107 ~~~~~~~~~~~~~~~~~~~~
108 
109+.. method:: select_related()
110+
111 Returns a ``QuerySet`` that will automatically "follow" foreign-key
112 relationships, selecting that additional related-object data when it executes
113 its query. This is a performance booster which results in (sometimes much)
114@@ -655,6 +679,8 @@
115 ``extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)``
116 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117 
118+.. method:: extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)
119+
120 Sometimes, the Django query syntax by itself can't easily express a complex
121 ``WHERE`` clause. For these edge cases, Django provides the ``extra()``
122 ``QuerySet`` modifier -- a hook for injecting specific clauses into the SQL
123@@ -817,6 +843,8 @@
124 ``defer(*fields)``
125 ~~~~~~~~~~~~~~~~~~
126 
127+.. method:: defer(*fields)
128+
129 .. versionadded:: 1.1
130 
131 In some complex data-modeling situations, your models might contain a lot of
132@@ -873,7 +901,9 @@
133     settled down and you understand where the hot-points are.
134 
135 ``only(*fields)``
136-~~~~~~~~~~~~~~~~~~
137+~~~~~~~~~~~~~~~~~
138+
139+.. method:: only(*fields)
140 
141 .. versionadded:: 1.1
142 
143@@ -909,7 +939,9 @@
144     Entry.objects.defer("body").only("headline", "body")
145 
146 ``using(alias)``
147-~~~~~~~~~~~~~~~~~~
148+~~~~~~~~~~~~~~~~
149+
150+.. method:: using(alias)
151 
152 .. versionadded:: 1.2
153 
154@@ -941,6 +973,8 @@
155 ``get(**kwargs)``
156 ~~~~~~~~~~~~~~~~~
157 
158+.. method:: get(**kwargs)
159+
160 Returns the object matching the given lookup parameters, which should be in
161 the format described in `Field lookups`_.
162 
163@@ -968,6 +1002,8 @@
164 ``create(**kwargs)``
165 ~~~~~~~~~~~~~~~~~~~~
166 
167+.. method:: create(**kwargs)
168+
169 A convenience method for creating an object and saving it all in one step.  Thus::
170 
171     p = Person.objects.create(first_name="Bruce", last_name="Springsteen")
172@@ -990,6 +1026,8 @@
173 ``get_or_create(**kwargs)``
174 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
175 
176+.. method:: get_or_create(**kwargs)
177+
178 A convenience method for looking up an object with the given kwargs, creating
179 one if necessary.
180 
181@@ -1058,6 +1096,8 @@
182 ``count()``
183 ~~~~~~~~~~~
184 
185+.. method:: count()
186+
187 Returns an integer representing the number of objects in the database matching
188 the ``QuerySet``. ``count()`` never raises exceptions.
189 
190@@ -1082,6 +1122,8 @@
191 ``in_bulk(id_list)``
192 ~~~~~~~~~~~~~~~~~~~~
193 
194+.. method:: in_bulk(id_list)
195+
196 Takes a list of primary-key values and returns a dictionary mapping each
197 primary-key value to an instance of the object with the given ID.
198 
199@@ -1101,6 +1143,8 @@
200 ``iterator()``
201 ~~~~~~~~~~~~~~
202 
203+.. method:: iterator()
204+
205 Evaluates the ``QuerySet`` (by performing the query) and returns an
206 `iterator`_ over the results. A ``QuerySet`` typically caches its
207 results internally so that repeated evaluations do not result in
208@@ -1117,6 +1161,8 @@
209 ``latest(field_name=None)``
210 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
211 
212+.. method:: latest(field_name=None)
213+
214 Returns the latest object in the table, by date, using the ``field_name``
215 provided as the date field.
216 
217@@ -1137,6 +1183,8 @@
218 ``aggregate(*args, **kwargs)``
219 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
220 
221+.. method:: aggregate(*args, **kwargs)
222+
223 .. versionadded:: 1.1
224 
225 Returns a dictionary of aggregate values (averages, sums, etc) calculated
226@@ -1169,6 +1217,8 @@
227 ``exists()``
228 ~~~~~~~~~~~~
229 
230+.. method:: exists()
231+
232 .. versionadded:: 1.2
233 
234 Returns ``True`` if the :class:`QuerySet` contains any results, and ``False``