mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.9.x] Fixed #25851 -- Removed links to deprecated assignment tag docs.
Backport of b6dd0afead from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							64200c14e0
						
					
				
				
					commit
					519cfbb4e8
				
			| @@ -649,8 +649,6 @@ positional arguments. For example: | |||||||
|  |  | ||||||
|     {% my_tag 123 "abcd" book.title warning=message|lower profile=user.profile %} |     {% my_tag 123 "abcd" book.title warning=message|lower profile=user.profile %} | ||||||
|  |  | ||||||
| .. _howto-custom-template-tags-assignment-tags: |  | ||||||
|  |  | ||||||
| Assignment tags | Assignment tags | ||||||
| ~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~ | ||||||
|  |  | ||||||
| @@ -1131,10 +1129,9 @@ The difference here is that ``do_current_time()`` grabs the format string and | |||||||
| the variable name, passing both to ``CurrentTimeNode3``. | the variable name, passing both to ``CurrentTimeNode3``. | ||||||
|  |  | ||||||
| Finally, if you only need to have a simple syntax for your custom | Finally, if you only need to have a simple syntax for your custom | ||||||
| context-updating template tag, you might want to consider using the | context-updating template tag, consider using the | ||||||
| :ref:`assignment tag <howto-custom-template-tags-assignment-tags>` shortcut | :meth:`~django.template.Library.simple_tag` shortcut, which supports assigning | ||||||
| we introduced above. | the tag results to a template variable. | ||||||
|  |  | ||||||
|  |  | ||||||
| Parsing until another block tag | Parsing until another block tag | ||||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|   | |||||||
| @@ -406,19 +406,17 @@ object generic views. | |||||||
| Assignment template tags | Assignment template tags | ||||||
| ~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|  |  | ||||||
| A new :ref:`assignment_tag<howto-custom-template-tags-assignment-tags>` helper | A new ``assignment_tag`` helper function was added to ``template.Library`` to | ||||||
| function was added to ``template.Library`` to ease the creation of template | ease the creation of template tags that store data in a specified context | ||||||
| tags that store data in a specified context variable. | variable. | ||||||
|  |  | ||||||
| ``*args`` and ``**kwargs`` support for template tag helper functions | ``*args`` and ``**kwargs`` support for template tag helper functions | ||||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|  |  | ||||||
| The :ref:`simple_tag<howto-custom-template-tags-simple-tags>`, | The :ref:`simple_tag<howto-custom-template-tags-simple-tags>`, | ||||||
| :ref:`inclusion_tag <howto-custom-template-tags-inclusion-tags>` and | :ref:`inclusion_tag <howto-custom-template-tags-inclusion-tags>` and newly | ||||||
| newly introduced | introduced ``assignment_tag`` template helper functions may now accept any | ||||||
| :ref:`assignment_tag<howto-custom-template-tags-assignment-tags>` template | number of positional or keyword arguments. For example:: | ||||||
| helper functions may now accept any number of positional or keyword arguments. |  | ||||||
| For example:: |  | ||||||
|  |  | ||||||
|     @register.simple_tag |     @register.simple_tag | ||||||
|     def my_tag(a, b, *args, **kwargs): |     def my_tag(a, b, *args, **kwargs): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user