Wednesday, January 25, 2017

Re: Multiple forms in the same template

On Tuesday 24 January 2017 05:07:25 schaf.mh@gmail.com wrote:

> sorry I wanted to shorten the code before, to not post too much.

> Here the code:

>

> views.py

> class MFormsView(LoginRequiredMixin, StaffuserRequiredMixin,

> UpdateView, MFView):

 

And there you have it:

MFormsView uses UpdateView which pulls in ModelFormMixin. So this view needs a fields attribute:

 

class M MFormsView(LoginRequiredMixin, StaffuserRequiredMixin, UpdateView, MFView):

fields = ['foo', 'bar', 'baz']

 

 

--

Melvyn Sopacua

No comments:

Post a Comment