Changes between Initial Version and Version 1 of Ticket #21753, comment 4
- Timestamp:
- Jan 9, 2014, 4:10:58 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21753, comment 4
initial v1 2 2 Generally fatter forms and thinner views are recommended. The above use-case should be solved by subclassing ModelForm and adapting the fields, then use the new ModelForm in the View. 3 3 4 Dynamic form creation dependent of request data can be done by passing data to Form.__init__()and adapting the fields there. Alternatively one can change the form_class in get_form_class by doing something like: return SuperForm if self.request.user.is_superuser else NormalForm.4 Dynamic form creation dependent of request data can be done by passing data to `Form.__init__()` and adapting the fields there. Alternatively one can change the form_class in get_form_class by doing something like: return SuperForm if self.request.user.is_superuser else NormalForm. 5 5 6 6 It should be noted in the docs that `fields` was added to View from a security point of view, not for customization of forms.