Code

Ticket #4303: db-api.diff

File db-api.diff, 5.2 KB (added by Gary Wilson <gary.wilson@…>, 7 years ago)

a couple other small fixes and ending whitespace removed

Line 
1=== modified file 'docs/db-api.txt'
2--- docs/db-api.txt     2007-05-07 16:38:08 +0000
3+++ docs/db-api.txt     2007-05-15 19:15:00 +0000
4@@ -143,8 +143,8 @@
5 follows this algorithm:
6 
7     * If the object's primary key attribute is set to a value that evaluates to
8-      ``True`` (i.e., a value other than ``None`` or the empty string), Django
9-      executes a ``SELECT`` query to determine whether a record with the given
10+      ``True`` (i.e., a value other than ``None`` or the empty string), Django
11+      executes a ``SELECT`` query to determine whether a record with the given
12       primary key already exists.
13     * If the record with the given primary key does already exist, Django
14       executes an ``UPDATE`` query.
15@@ -525,19 +525,19 @@
16     [datetime.datetime(2005, 3, 20), datetime.datetime(2005, 2, 20)]
17     >>> Entry.objects.filter(headline__contains='Lennon').dates('pub_date', 'day')
18     [datetime.datetime(2005, 3, 20)]
19-   
20+
21 ``none()``
22 ~~~~~~~~~~
23 
24 **New in Django development version**
25 
26-Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to
27+Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to
28 an empty list. This can be used in cases where you know that you should
29 return an empty result set and your caller is expecting a ``QuerySet``
30 object (instead of returning an empty list, for example.)
31 
32 Examples::
33-   
34+
35     >>> Entry.objects.none()
36     []
37 
38@@ -610,7 +610,7 @@
39     c = p.hometown       # Requires a database call.
40 
41 The ``depth`` argument is new in the Django development version.
42-   
43+
44 ``extra(select=None, where=None, params=None, tables=None)``
45 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46 
47@@ -1136,7 +1136,7 @@
48 isnull
49 ~~~~~~
50 
51-Takes either ``True`` or ``False``, which correspond to SQL queries of
52+Takes either ``True`` or ``False``, which correspond to SQL queries of
53 ``IS NULL`` and ``IS NOT NULL``, respectively.
54 
55 Example::
56@@ -1149,10 +1149,10 @@
57 
58 .. admonition:: ``__isnull=True`` vs ``__exact=None``
59 
60-    There is an important difference between ``__isnull=True`` and
61+    There is an important difference between ``__isnull=True`` and
62     ``__exact=None``. ``__exact=None`` will *always* return an empty result
63-    set, because SQL requires that no value is equal to ``NULL``.
64-    ``__isnull`` determines if the field is currently holding the value
65+    set, because SQL requires that no value is equal to ``NULL``.
66+    ``__isnull`` determines if the field is currently holding the value
67     of ``NULL`` without performing a comparison.
68 
69 search
70@@ -1181,7 +1181,7 @@
71 ----------------------
72 
73 For convenience, Django provides a ``pk`` lookup type, which stands for
74-"primary_key".
75+"primary_key".
76 
77 In the example ``Blog`` model, the primary key is the ``id`` field, so these
78 three statements are equivalent::
79@@ -1190,14 +1190,14 @@
80     Blog.objects.get(id=14) # __exact is implied
81     Blog.objects.get(pk=14) # pk implies id__exact
82 
83-The use of ``pk`` isn't limited to ``__exact`` queries -- any query term
84+The use of ``pk`` isn't limited to ``__exact`` queries -- any query term
85 can be combined with ``pk`` to perform a query on the primary key of a model::
86 
87     # Get blogs entries  with id 1, 4 and 7
88     Blog.objects.filter(pk__in=[1,4,7])
89     # Get all blog entries with id > 14
90-    Blog.objects.filter(pk__gt=14)
91-   
92+    Blog.objects.filter(pk__gt=14)
93+
94 ``pk`` lookups also work across joins. For example, these three statements are
95 equivalent::
96 
97@@ -1754,19 +1754,19 @@
98 -------------------
99 
100 One common idiom to use ``get()`` and raise ``Http404`` if the
101-object doesn't exist. This idiom is captured by ``get_object_or_404()``.
102-This function takes a Django model as its first argument and an
103-arbitrary number of keyword arguments, which it passes to the manager's
104+object doesn't exist. This idiom is captured by ``get_object_or_404()``.
105+This function takes a Django model as its first argument and an
106+arbitrary number of keyword arguments, which it passes to the manager's
107 ``get()`` function. It raises ``Http404`` if the object doesn't
108-exist. For example::
109-   
110+exist. For example::
111+
112     # Get the Entry with a primary key of 3
113     e = get_object_or_404(Entry, pk=3)
114 
115-When you provide a model to this shortcut function, the default manager
116-is used to execute the underlying ``get()`` query. If you don't want to
117-use the default manager, or you want to search a list of related objects,
118-you can provide ``get_object_or_404()`` with a manager object, instead.
119+When you provide a model to this shortcut function, the default manager
120+is used to execute the underlying ``get()`` query. If you don't want to
121+use the default manager, or if you want to search a list of related objects,
122+you can provide ``get_object_or_404()`` with a manager object instead.
123 For example::
124 
125     # Get the author of blog instance `e` with a name of 'Fred'
126@@ -1779,8 +1779,8 @@
127 get_list_or_404()
128 -----------------
129 
130-``get_list_or_404`` behaves the same was as ``get_object_or_404()``
131--- except the it uses using ``filter()`` instead of ``get()``. It raises
132+``get_list_or_404`` behaves the same way as ``get_object_or_404()``
133+-- except that it uses ``filter()`` instead of ``get()``. It raises
134 ``Http404`` if the list is empty.
135 
136 Falling back to raw SQL
137