mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-31 16:07:38 +03:00 
			
		
		
		
	Disable HTML inputs for dict/list fields (#5702)
This commit is contained in:
		
							parent
							
								
									6bd773e7f8
								
							
						
					
					
						commit
						b7ed645927
					
				|  | @ -320,6 +320,12 @@ class HTMLFormRenderer(BaseRenderer): | |||
|         serializers.ListSerializer: { | ||||
|             'base_template': 'list_fieldset.html' | ||||
|         }, | ||||
|         serializers.ListField: { | ||||
|             'base_template': 'list_field.html' | ||||
|         }, | ||||
|         serializers.DictField: { | ||||
|             'base_template': 'dict_field.html' | ||||
|         }, | ||||
|         serializers.FilePathField: { | ||||
|             'base_template': 'select.html', | ||||
|         }, | ||||
|  |  | |||
|  | @ -0,0 +1,11 @@ | |||
| <div class="form-group"> | ||||
|   {% if field.label %} | ||||
|     <label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"> | ||||
|       {{ field.label }} | ||||
|     </label> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <div class="col-sm-10"> | ||||
|     <p class="form-control-static">Dictionaries are not currently supported in HTML input.</p> | ||||
|   </div> | ||||
| </div> | ||||
|  | @ -0,0 +1,11 @@ | |||
| <div class="form-group"> | ||||
|   {% if field.label %} | ||||
|     <label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"> | ||||
|       {{ field.label }} | ||||
|     </label> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <div class="col-sm-10"> | ||||
|     <p class="form-control-static">Lists are not currently supported in HTML input.</p> | ||||
|   </div> | ||||
| </div> | ||||
|  | @ -0,0 +1,9 @@ | |||
| <div class="form-group"> | ||||
|   {% if field.label %} | ||||
|     <label class="sr-only"> | ||||
|       {{ field.label }} | ||||
|     </label> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <p class="form-control-static">Dictionaries are not currently supported in HTML input.</p> | ||||
| </div> | ||||
|  | @ -0,0 +1,9 @@ | |||
| <div class="form-group"> | ||||
|   {% if field.label %} | ||||
|     <label class="sr-only"> | ||||
|       {{ field.label }} | ||||
|     </label> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <p class="form-control-static">Lists are not currently supported in HTML input.</p> | ||||
| </div> | ||||
|  | @ -0,0 +1,7 @@ | |||
| <div class="form-group"> | ||||
|   {% if field.label %} | ||||
|     <label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <p class="form-control-static">Dictionaries are not currently supported in HTML input.</p> | ||||
| </div> | ||||
|  | @ -0,0 +1,7 @@ | |||
| <div class="form-group"> | ||||
|   {% if field.label %} | ||||
|     <label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <p class="form-control-static">Lists are not currently supported in HTML input.</p> | ||||
| </div> | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user