#33074: Do not require fields on UpdateView/CreateView if form specified
-------------------------------------+-------------------------------------
               Reporter:  Dan Swain  |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Generic    |        Version:  3.2
  views                              |       Keywords:  CreateView
               Severity:  Normal     |  UpdateView form ModelFormMixin
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When a form class is specified on CreateView or UpdateView, then even
 though the fields are specified on the form, the following error occurs:

 django.core.exceptions.ImproperlyConfigured: Using ModelFormMixin (base
 class of MyModelCreateView) without the 'fields' attribute is prohibited.

 It seems like fields should not have to be specified on a CreateView or
 UpdateView when a form is specified since fields HAVE to be specified on a
 form.  Why can't the view just use the fields specified on the form?
 Raising this error when no fields have been specified on the view but a
 form HAS been specified seems to go against DRY.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33074>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.73020fdf4328deaf3bf4c53d14455b2a%40djangoproject.com.

Reply via email to