Code

Ticket #11800: 11800.diff

File 11800.diff, 7.1 KB (added by timo, 4 years ago)
Line 
1Index: docs/topics/db/optimization.txt
2===================================================================
3--- docs/topics/db/optimization.txt     (revision 13301)
4+++ docs/topics/db/optimization.txt     (working copy)
5@@ -101,7 +101,7 @@
6 
7 When you have a lot of objects, the caching behaviour of the ``QuerySet`` can
8 cause a large amount of memory to be used. In this case,
9-:ref:`QuerySet.iterator() <queryset-iterator>` may help.
10+:meth:`~django.db.models.QuerySet.iterator()` may help.
11 
12 Do database work in the database rather than in Python
13 ======================================================
14@@ -122,9 +122,9 @@
15 Use ``QuerySet.extra()``
16 ------------------------
17 
18-A less portable but more powerful method is :ref:`QuerySet.extra()
19-<queryset-extra>`, which allows some SQL to be explicitly added to the query.
20-If that still isn't powerful enough:
21+A less portable but more powerful method is
22+:meth:`~django.db.models.QuerySet.extra()`, which allows some SQL to be
23+explicitly added to the query. If that still isn't powerful enough:
24 
25 Use raw SQL
26 -----------
27@@ -160,7 +160,7 @@
28 -----------------------------------------------
29 
30 When you just want a dict/list of values, and don't need ORM model objects, make
31-appropriate usage of :ref:`QuerySet.values() <queryset-values>`.
32+appropriate usage of :meth:`~django.db.models.QuerySet.values()`.
33 These can be useful for replacing model objects in template code - as long as
34 the dicts you supply have the same attributes as those used in the template, you
35 are fine.
36@@ -168,7 +168,8 @@
37 Use ``QuerySet.defer()`` and ``only()``
38 ---------------------------------------
39 
40-Use :ref:`defer() and only() <queryset-defer>` if there are database columns you
41+Use :meth:`~django.db.models.QuerySet.defer()` and
42+:meth:`~django.db.models.QuerySet.only()` if there are database columns you
43 know that you won't need (or won't need in most cases) to avoid loading
44 them. Note that if you *do* use them, the ORM will have to go and get them in a
45 separate query, making this a pessimization if you use it inappropriately.
46Index: docs/topics/db/aggregation.txt
47===================================================================
48--- docs/topics/db/aggregation.txt      (revision 13301)
49+++ docs/topics/db/aggregation.txt      (working copy)
50@@ -353,7 +353,7 @@
51 query.
52 
53 This behavior is the same as that noted in the queryset documentation for
54-:ref:`distinct() <queryset-distinct>` and the general rule is the same:
55+:meth:`~django.db.models.QuerySet.distinct` and the general rule is the same:
56 normally you won't want extra columns playing a part in the result, so clear
57 out the ordering, or at least make sure it's restricted only to those fields
58 you also select in a ``values()`` call.
59Index: docs/topics/db/sql.txt
60===================================================================
61--- docs/topics/db/sql.txt      (revision 13301)
62+++ docs/topics/db/sql.txt      (working copy)
63@@ -116,9 +116,9 @@
64 
65     >>> people = Person.objects.raw('SELECT id, first_name FROM myapp_person')
66 
67-The ``Person`` objects returned by this query will be :ref:`deferred
68-<queryset-defer>` model instances. This means that the fields that are omitted
69-from the query will be loaded on demand. For example::
70+The ``Person`` objects returned by this query will be deferred model instances
71+(see :meth:`~django.db.models.QuerySet.defer()`). This means that the fields
72+that are omitted from the query will be loaded on demand. For example::
73 
74     >>> for p in Person.objects.raw('SELECT id, first_name FROM myapp_person'):
75     ...     print p.first_name, # This will be retrieved by the original query
76Index: docs/releases/1.1-beta-1.txt
77===================================================================
78--- docs/releases/1.1-beta-1.txt        (revision 13301)
79+++ docs/releases/1.1-beta-1.txt        (working copy)
80@@ -71,8 +71,9 @@
81 particular fields, you can now tell Django not to retrieve them from the
82 database.
83 
84-You'll do this with the :ref:`new queryset methods <queryset-defer>`
85-``defer()`` and ``only()``.
86+You'll do this with the new queryset methods
87+:meth:`~django.db.models.QuerySet.defer` and
88+:meth:`~django.db.models.QuerySet.only`.
89 
90 New admin features
91 ------------------
92Index: docs/releases/1.1.txt
93===================================================================
94--- docs/releases/1.1.txt       (revision 13301)
95+++ docs/releases/1.1.txt       (working copy)
96@@ -258,8 +258,9 @@
97 particular fields, you can now tell Django not to retrieve them from the
98 database.
99 
100-You'll do this with the :ref:`new queryset methods <queryset-defer>`
101-``defer()`` and ``only()``.
102+You'll do this with the new queryset methods
103+:meth:`~django.db.models.QuerySet.defer` and
104+:meth:`~django.db.models.QuerySet.only`.
105 
106 Testing improvements
107 --------------------
108Index: docs/ref/models/querysets.txt
109===================================================================
110--- docs/ref/models/querysets.txt       (revision 13301)
111+++ docs/ref/models/querysets.txt       (working copy)
112@@ -332,8 +332,6 @@
113 ordering was undefined prior to calling ``reverse()``, and will remain
114 undefined afterward).
115 
116-.. _queryset-distinct:
117-
118 ``distinct()``
119 ~~~~~~~~~~~~~~
120 
121@@ -367,9 +365,6 @@
122     ``values()`` together, be careful when ordering by fields not in the
123     ``values()`` call.
124 
125-
126-.. _queryset-values:
127-
128 ``values(*fields)``
129 ~~~~~~~~~~~~~~~~~~~
130 
131@@ -679,8 +674,6 @@
132 ``OneToOneFields`` will not be traversed in the reverse direction if you
133 are performing a depth-based ``select_related``.
134 
135-.. _queryset-extra:
136-
137 ``extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)``
138 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139 
140@@ -843,8 +836,6 @@
141 
142         Entry.objects.extra(where=['headline=%s'], params=['Lennon'])
143 
144-.. _queryset-defer:
145-
146 ``defer(*fields)``
147 ~~~~~~~~~~~~~~~~~~
148 
149@@ -1143,8 +1134,6 @@
150 
151 If you pass ``in_bulk()`` an empty list, you'll get an empty dictionary.
152 
153-.. _queryset-iterator:
154-
155 ``iterator()``
156 ~~~~~~~~~~~~~~
157 
158Index: docs/ref/contrib/admin/index.txt
159===================================================================
160--- docs/ref/contrib/admin/index.txt    (revision 13301)
161+++ docs/ref/contrib/admin/index.txt    (working copy)
162@@ -474,18 +474,17 @@
163 
164 .. attribute:: ModelAdmin.list_select_related
165 
166-Set ``list_select_related`` to tell Django to use ``select_related()`` in
167-retrieving the list of objects on the admin change list page. This can save you
168-a bunch of database queries.
169+Set ``list_select_related`` to tell Django to use
170+:meth:`~django.db.models.QuerySet.select_related` in retrieving the list of
171+objects on the admin change list page. This can save you a bunch of database
172+queries.
173 
174 The value should be either ``True`` or ``False``. Default is ``False``.
175 
176-Note that Django will use ``select_related()``, regardless of this setting,
177-if one of the ``list_display`` fields is a ``ForeignKey``.
178+Note that Django will use :meth:`~django.db.models.QuerySet.select_related`,
179+regardless of this setting, if one of the ``list_display`` fields is a
180+``ForeignKey``.
181 
182-For more on ``select_related()``, see
183-:ref:`the select_related() docs <select-related>`.
184-
185 .. attribute:: ModelAdmin.inlines
186 
187 See ``InlineModelAdmin`` objects below.