mirror of
				https://github.com/django/django.git
				synced 2025-11-04 13:39:16 +00:00 
			
		
		
		
	Fixed typos and example in signals.pre_init docs.
This commit is contained in:
		
							parent
							
								
									b08a18f17b
								
							
						
					
					
						commit
						036362e0cf
					
				
					 1 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
					@ -60,26 +60,27 @@ Arguments sent with this signal:
 | 
				
			||||||
    The model class that just had an instance created.
 | 
					    The model class that just had an instance created.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
``args``
 | 
					``args``
 | 
				
			||||||
    A list of positional arguments passed to ``__init__()``:
 | 
					    A list of positional arguments passed to ``__init__()``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
``kwargs``
 | 
					``kwargs``
 | 
				
			||||||
    A dictionary of keyword arguments passed to ``__init__()``:
 | 
					    A dictionary of keyword arguments passed to ``__init__()``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For example, the :doc:`tutorial </intro/tutorial01>` has this line::
 | 
					For example, the :doc:`tutorial </intro/tutorial02>` has this line::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    p = Poll(question="What's up?", pub_date=datetime.now())
 | 
					    q = Question(question_text="What's new?", pub_date=timezone.now())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The arguments sent to a :data:`pre_init` handler would be:
 | 
					The arguments sent to a :data:`pre_init` handler would be:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
==========  ===============================================================
 | 
					==========  ===============================================================
 | 
				
			||||||
Argument    Value
 | 
					Argument    Value
 | 
				
			||||||
==========  ===============================================================
 | 
					==========  ===============================================================
 | 
				
			||||||
``sender``  ``Poll`` (the class itself)
 | 
					``sender``  ``Question`` (the class itself)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
``args``    ``[]`` (an empty list because there were no positional
 | 
					``args``    ``[]`` (an empty list because there were no positional
 | 
				
			||||||
            arguments passed to ``__init__()``.)
 | 
					            arguments passed to ``__init__()``)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
``kwargs``  ``{'question': "What's up?", 'pub_date': datetime.now()}``
 | 
					``kwargs``  ``{'question_text': "What's new?",``
 | 
				
			||||||
 | 
					            ``'pub_date': datetime.datetime(2012, 2, 26, 13, 0, 0, 775217, tzinfo=<UTC>)}``
 | 
				
			||||||
==========  ===============================================================
 | 
					==========  ===============================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
``post_init``
 | 
					``post_init``
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue