mirror of
				https://github.com/django/django.git
				synced 2025-10-26 23:26:08 +00:00 
			
		
		
		
	[1.6.x] Fixed #21100 -- Noted that Create/UpdateViews.fields is new in 1.6
Thanks AndrewIngram for the suggestion.
Backport of ec89e1725a from master
			
			
This commit is contained in:
		| @@ -1061,12 +1061,12 @@ security problem described in the section above, because they can automatically | |||||||
| create a ``ModelForm`` that uses all fields for a model. | create a ``ModelForm`` that uses all fields for a model. | ||||||
|  |  | ||||||
| For this reason, if you use these views for editing models, you must also supply | For this reason, if you use these views for editing models, you must also supply | ||||||
| the ``fields`` attribute, which is a list of model fields and works in the same | the ``fields`` attribute (new in Django 1.6), which is a list of model fields | ||||||
| way as the :class:`~django.forms.ModelForm` ``Meta.fields`` attribute. Alternatively, | and works in the same way as the :class:`~django.forms.ModelForm` | ||||||
| you can set set the ``form_class`` attribute to a ``ModelForm`` that explicitly | ``Meta.fields`` attribute. Alternatively, you can set set the ``form_class`` | ||||||
| defines the fields to be used. Defining an ``UpdateView`` or ``CreateView`` | attribute to a ``ModelForm`` that explicitly defines the fields to be used. | ||||||
| subclass to be used with a model but without an explicit list of fields is | Defining an ``UpdateView`` or ``CreateView`` subclass to be used with a model | ||||||
| deprecated. | but without an explicit list of fields is deprecated. | ||||||
|  |  | ||||||
| .. _m2m-help_text-deprecation: | .. _m2m-help_text-deprecation: | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user