mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #25582 -- Doc'd query and fragment arguments for reverse_lazy().
This commit is contained in:
		
				
					committed by
					
						 Sarah Boyce
						Sarah Boyce
					
				
			
			
				
	
			
			
			
						parent
						
							955b7c6ba1
						
					
				
				
					commit
					c70dbcf835
				
			| @@ -132,7 +132,7 @@ For example: | |||||||
|  |  | ||||||
| A lazily evaluated version of `reverse()`_. | A lazily evaluated version of `reverse()`_. | ||||||
|  |  | ||||||
| .. function:: reverse_lazy(viewname, urlconf=None, args=None, kwargs=None, current_app=None) | .. function:: reverse_lazy(viewname, urlconf=None, args=None, kwargs=None, current_app=None, *, query=None, fragment=None) | ||||||
|  |  | ||||||
| It is useful for when you need to use a URL reversal before your project's | It is useful for when you need to use a URL reversal before your project's | ||||||
| URLConf is loaded. Some common cases where this function is necessary are: | URLConf is loaded. Some common cases where this function is necessary are: | ||||||
| @@ -147,6 +147,10 @@ URLConf is loaded. Some common cases where this function is necessary are: | |||||||
| * providing a reversed URL as a default value for a parameter in a function's | * providing a reversed URL as a default value for a parameter in a function's | ||||||
|   signature. |   signature. | ||||||
|  |  | ||||||
|  | .. versionchanged:: 5.2 | ||||||
|  |  | ||||||
|  |     The ``query`` and ``fragment`` arguments were added. | ||||||
|  |  | ||||||
| ``resolve()`` | ``resolve()`` | ||||||
| ============= | ============= | ||||||
|  |  | ||||||
|   | |||||||
| @@ -371,9 +371,9 @@ Tests | |||||||
| URLs | URLs | ||||||
| ~~~~ | ~~~~ | ||||||
|  |  | ||||||
| * :func:`~django.urls.reverse` now accepts ``query`` and ``fragment`` keyword | * :func:`~django.urls.reverse` and :func:`~django.urls.reverse_lazy` now accept | ||||||
|   arguments, allowing the addition of a query string and/or fragment identifier |   ``query`` and ``fragment`` keyword arguments, allowing the addition of a | ||||||
|   in the generated URL, respectively. |   query string and/or fragment identifier in the generated URL, respectively. | ||||||
|  |  | ||||||
| Utilities | Utilities | ||||||
| ~~~~~~~~~ | ~~~~~~~~~ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user