Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #15207 -- Added versionadded directives for the "using" argumen…

…t sent by signals, and cleaned up some incidental indentation/formatting inconsistencies. Thanks to Keryn Knight for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 608877c066fd69879476ced8d057fa73530da100 1 parent f6e38f3
authored

Showing 1 changed file with 141 additions and 131 deletions. Show diff stats Hide diff stats

  1. 272  docs/ref/signals.txt
272  docs/ref/signals.txt
@@ -51,16 +51,16 @@ of the model's :meth:`~django.db.models.Model.__init__` method.
51 51
 
52 52
 Arguments sent with this signal:
53 53
 
54  
-    ``sender``
55  
-        The model class that just had an instance created.
  54
+``sender``
  55
+    The model class that just had an instance created.
56 56
 
57  
-    ``args``
58  
-        A list of positional arguments passed to
59  
-        :meth:`~django.db.models.Model.__init__`:
  57
+``args``
  58
+    A list of positional arguments passed to
  59
+    :meth:`~django.db.models.Model.__init__`:
60 60
 
61  
-    ``kwargs``
62  
-        A dictionary of keyword arguments passed to
63  
-        :meth:`~django.db.models.Model.__init__`:.
  61
+``kwargs``
  62
+    A dictionary of keyword arguments passed to
  63
+    :meth:`~django.db.models.Model.__init__`:.
64 64
 
65 65
 For example, the :doc:`tutorial </intro/tutorial01>` has this line:
66 66
 
@@ -91,11 +91,11 @@ Like pre_init, but this one is sent when the :meth:`~django.db.models.Model.__in
91 91
 
92 92
 Arguments sent with this signal:
93 93
 
94  
-    ``sender``
95  
-        As above: the model class that just had an instance created.
  94
+``sender``
  95
+    As above: the model class that just had an instance created.
96 96
 
97  
-    ``instance``
98  
-        The actual instance of the model that's just been created.
  97
+``instance``
  98
+    The actual instance of the model that's just been created.
99 99
 
100 100
 pre_save
101 101
 --------
@@ -108,14 +108,16 @@ method.
108 108
 
109 109
 Arguments sent with this signal:
110 110
 
111  
-    ``sender``
112  
-        The model class.
  111
+``sender``
  112
+    The model class.
113 113
 
114  
-    ``instance``
115  
-        The actual instance being saved.
  114
+``instance``
  115
+    The actual instance being saved.
116 116
 
117  
-    ``using``
118  
-        The database alias being used.
  117
+.. versionadded:: 1.3
  118
+
  119
+``using``
  120
+    The database alias being used.
119 121
 
120 122
 post_save
121 123
 ---------
@@ -128,17 +130,19 @@ Like :data:`pre_save`, but sent at the end of the
128 130
 
129 131
 Arguments sent with this signal:
130 132
 
131  
-    ``sender``
132  
-        The model class.
  133
+``sender``
  134
+    The model class.
133 135
 
134  
-    ``instance``
135  
-        The actual instance being saved.
  136
+``instance``
  137
+    The actual instance being saved.
136 138
 
137  
-    ``created``
138  
-        A boolean; ``True`` if a new record was created.
  139
+``created``
  140
+    A boolean; ``True`` if a new record was created.
139 141
 
140  
-    ``using``
141  
-        The database alias being used.
  142
+.. versionadded:: 1.3
  143
+
  144
+``using``
  145
+    The database alias being used.
142 146
 
143 147
 pre_delete
144 148
 ----------
@@ -151,14 +155,16 @@ method.
151 155
 
152 156
 Arguments sent with this signal:
153 157
 
154  
-    ``sender``
155  
-        The model class.
  158
+``sender``
  159
+    The model class.
  160
+
  161
+``instance``
  162
+    The actual instance being deleted.
156 163
 
157  
-    ``instance``
158  
-        The actual instance being deleted.
  164
+.. versionadded:: 1.3
159 165
 
160  
-    ``using``
161  
-        The database alias being used.
  166
+``using``
  167
+    The database alias being used.
162 168
 
163 169
 post_delete
164 170
 -----------
@@ -171,17 +177,19 @@ Like :data:`pre_delete`, but sent at the end of the
171 177
 
172 178
 Arguments sent with this signal:
173 179
 
174  
-    ``sender``
175  
-        The model class.
  180
+``sender``
  181
+    The model class.
  182
+
  183
+``instance``
  184
+    The actual instance being deleted.
176 185
 
177  
-    ``instance``
178  
-        The actual instance being deleted.
  186
+    Note that the object will no longer be in the database, so be very
  187
+    careful what you do with this instance.
179 188
 
180  
-        Note that the object will no longer be in the database, so be very
181  
-        careful what you do with this instance.
  189
+.. versionadded:: 1.3
182 190
 
183  
-    ``using``
184  
-        The database alias being used.
  191
+``using``
  192
+    The database alias being used.
185 193
 
186 194
 m2m_changed
187 195
 -----------
@@ -199,51 +207,53 @@ when it comes to tracking changes to models, it is included here.
199 207
 
200 208
 Arguments sent with this signal:
201 209
 
202  
-    ``sender``
203  
-        The intermediate model class describing the :class:`ManyToManyField`.
204  
-        This class is automatically created when a many-to-many field is
205  
-        defined; you can access it using the ``through`` attribute on the
206  
-        many-to-many field.
207  
-
208  
-    ``instance``
209  
-        The instance whose many-to-many relation is updated. This can be an
210  
-        instance of the ``sender``, or of the class the :class:`ManyToManyField`
211  
-        is related to.
212  
-
213  
-    ``action``
214  
-        A string indicating the type of update that is done on the relation.
215  
-        This can be one of the following:
216  
-
217  
-        ``"pre_add"``
218  
-            Sent *before* one or more objects are added to the relation
219  
-        ``"post_add"``
220  
-            Sent *after* one or more objects are added to the relation
221  
-        ``"pre_remove"``
222  
-            Sent *after* one or more objects are removed from the relation
223  
-        ``"post_remove"``
224  
-            Sent *after* one or more objects are removed from the relation
225  
-        ``"pre_clear"``
226  
-            Sent *before* the relation is cleared
227  
-        ``"post_clear"``
228  
-            Sent *after* the relation is cleared
229  
-
230  
-    ``reverse``
231  
-        Indicates which side of the relation is updated (i.e., if it is the
232  
-        forward or reverse relation that is being modified).
233  
-
234  
-    ``model``
235  
-        The class of the objects that are added to, removed from or cleared
236  
-        from the relation.
237  
-
238  
-    ``pk_set``
239  
-        For the ``pre_add``, ``post_add``, ``pre_remove`` and ``post_remove``
240  
-        actions, this is a list of primary key values that have been added to
241  
-        or removed from the relation.
242  
-
243  
-        For the ``pre_clear`` and ``post_clear`` actions, this is ``None``.
244  
-
245  
-    ``using``
246  
-        The database alias being used.
  210
+``sender``
  211
+    The intermediate model class describing the :class:`ManyToManyField`.
  212
+    This class is automatically created when a many-to-many field is
  213
+    defined; you can access it using the ``through`` attribute on the
  214
+    many-to-many field.
  215
+
  216
+``instance``
  217
+    The instance whose many-to-many relation is updated. This can be an
  218
+    instance of the ``sender``, or of the class the :class:`ManyToManyField`
  219
+    is related to.
  220
+
  221
+``action``
  222
+    A string indicating the type of update that is done on the relation.
  223
+    This can be one of the following:
  224
+
  225
+    ``"pre_add"``
  226
+        Sent *before* one or more objects are added to the relation
  227
+    ``"post_add"``
  228
+        Sent *after* one or more objects are added to the relation
  229
+    ``"pre_remove"``
  230
+        Sent *after* one or more objects are removed from the relation
  231
+    ``"post_remove"``
  232
+        Sent *after* one or more objects are removed from the relation
  233
+    ``"pre_clear"``
  234
+        Sent *before* the relation is cleared
  235
+    ``"post_clear"``
  236
+        Sent *after* the relation is cleared
  237
+
  238
+``reverse``
  239
+    Indicates which side of the relation is updated (i.e., if it is the
  240
+    forward or reverse relation that is being modified).
  241
+
  242
+``model``
  243
+    The class of the objects that are added to, removed from or cleared
  244
+    from the relation.
  245
+
  246
+``pk_set``
  247
+    For the ``pre_add``, ``post_add``, ``pre_remove`` and ``post_remove``
  248
+    actions, this is a list of primary key values that have been added to
  249
+    or removed from the relation.
  250
+
  251
+    For the ``pre_clear`` and ``post_clear`` actions, this is ``None``.
  252
+
  253
+.. versionadded:: 1.3
  254
+
  255
+``using``
  256
+    The database alias being used.
247 257
 
248 258
 For example, if a ``Pizza`` can have multiple ``Topping`` objects, modeled
249 259
 like this:
@@ -351,32 +361,32 @@ handlers are registered anywhere else they may not be loaded by
351 361
 
352 362
 Arguments sent with this signal:
353 363
 
354  
-    ``sender``
355  
-        The ``models`` module that was just installed. That is, if
356  
-        :djadmin:`syncdb` just installed an app called ``"foo.bar.myapp"``,
357  
-        ``sender`` will be the ``foo.bar.myapp.models`` module.
  364
+``sender``
  365
+    The ``models`` module that was just installed. That is, if
  366
+    :djadmin:`syncdb` just installed an app called ``"foo.bar.myapp"``,
  367
+    ``sender`` will be the ``foo.bar.myapp.models`` module.
358 368
 
359  
-    ``app``
360  
-        Same as ``sender``.
  369
+``app``
  370
+    Same as ``sender``.
361 371
 
362  
-    ``created_models``
363  
-        A list of the model classes from any app which :djadmin:`syncdb` has
364  
-        created so far.
  372
+``created_models``
  373
+    A list of the model classes from any app which :djadmin:`syncdb` has
  374
+    created so far.
365 375
 
366  
-    ``verbosity``
367  
-        Indicates how much information manage.py is printing on screen. See
368  
-        the :djadminopt:`--verbosity` flag for details.
  376
+``verbosity``
  377
+    Indicates how much information manage.py is printing on screen. See
  378
+    the :djadminopt:`--verbosity` flag for details.
369 379
 
370  
-        Functions which listen for :data:`post_syncdb` should adjust what they
371  
-        output to the screen based on the value of this argument.
  380
+    Functions which listen for :data:`post_syncdb` should adjust what they
  381
+    output to the screen based on the value of this argument.
372 382
 
373  
-    ``interactive``
374  
-        If ``interactive`` is ``True``, it's safe to prompt the user to input
375  
-        things on the command line. If ``interactive`` is ``False``, functions
376  
-        which listen for this signal should not try to prompt for anything.
  383
+``interactive``
  384
+    If ``interactive`` is ``True``, it's safe to prompt the user to input
  385
+    things on the command line. If ``interactive`` is ``False``, functions
  386
+    which listen for this signal should not try to prompt for anything.
377 387
 
378  
-        For example, the :mod:`django.contrib.auth` app only prompts to create a
379  
-        superuser when ``interactive`` is ``True``.
  388
+    For example, the :mod:`django.contrib.auth` app only prompts to create a
  389
+    superuser when ``interactive`` is ``True``.
380 390
 
381 391
 For example, yourapp/signals/__init__.py could be written like::
382 392
 
@@ -407,10 +417,10 @@ Sent when Django begins processing an HTTP request.
407 417
 
408 418
 Arguments sent with this signal:
409 419
 
410  
-    ``sender``
411  
-        The handler class -- e.g.
412  
-        :class:`django.core.handlers.wsgi.WsgiHandler` -- that handled
413  
-        the request.
  420
+``sender``
  421
+    The handler class -- e.g.
  422
+    :class:`django.core.handlers.wsgi.WsgiHandler` -- that handled
  423
+    the request.
414 424
 
415 425
 request_finished
416 426
 ----------------
@@ -422,8 +432,8 @@ Sent when Django finishes processing an HTTP request.
422 432
 
423 433
 Arguments sent with this signal:
424 434
 
425  
-    ``sender``
426  
-        The handler class, as above.
  435
+``sender``
  436
+    The handler class, as above.
427 437
 
428 438
 got_request_exception
429 439
 ---------------------
@@ -435,11 +445,11 @@ This signal is sent whenever Django encounters an exception while processing an
435 445
 
436 446
 Arguments sent with this signal:
437 447
 
438  
-    ``sender``
439  
-        The handler class, as above.
  448
+``sender``
  449
+    The handler class, as above.
440 450
 
441  
-    ``request``
442  
-        The :class:`~django.http.HttpRequest` object.
  451
+``request``
  452
+    The :class:`~django.http.HttpRequest` object.
443 453
 
444 454
 Test signals
445 455
 ============
@@ -460,15 +470,15 @@ normal operation of a Django server -- it is only available during testing.
460 470
 
461 471
 Arguments sent with this signal:
462 472
 
463  
-    sender
464  
-        The :class:`~django.template.Template` object which was rendered.
  473
+``sender``
  474
+    The :class:`~django.template.Template` object which was rendered.
465 475
 
466  
-    template
467  
-        Same as sender
  476
+``template``
  477
+    Same as sender
468 478
 
469  
-    context
470  
-        The :class:`~django.template.Context` with which the template was
471  
-        rendered.
  479
+``context``
  480
+    The :class:`~django.template.Context` with which the template was
  481
+    rendered.
472 482
 
473 483
 Database Wrappers
474 484
 =================
@@ -494,12 +504,12 @@ connection commands to the SQL backend.
494 504
 
495 505
 Arguments sent with this signal:
496 506
 
497  
-    sender
498  
-        The database wrapper class -- i.e.
499  
-        :class:`django.db.backends.postgresql_psycopg2.DatabaseWrapper` or
500  
-        :class:`django.db.backends.mysql.DatabaseWrapper`, etc.
501  
-
502  
-    connection
503  
-        The database connection that was opened. This can be used in a
504  
-        multiple-database configuration to differentiate connection signals
505  
-        from different databases.
  507
+``sender``
  508
+    The database wrapper class -- i.e.
  509
+    :class:`django.db.backends.postgresql_psycopg2.DatabaseWrapper` or
  510
+    :class:`django.db.backends.mysql.DatabaseWrapper`, etc.
  511
+
  512
+``connection``
  513
+    The database connection that was opened. This can be used in a
  514
+    multiple-database configuration to differentiate connection signals
  515
+    from different databases.

0 notes on commit 608877c

Please sign in to comment.
Something went wrong with that request. Please try again.