There is something missing about the usage of the jquery plugin. I do not see the 'add' and remove' buttons added to the html at my end.
The jquery add and remove buttons works only if there set a context['formset'] name. I do not know why. Maybe django 2 version or needs change the class Formset(LayoutObject)
So its works:
forms.py:
Fieldset( 'Add videos', Formset('formset'), ),
views:
context['formset'] = PostVideoFormSet( self.request.POST, instance=self.object)
but if change this name to:
Fieldset( 'Add videos', Formset('videos'), ), and context['videos'] = PostVideoFormSet( self.request.POST, instance=self.object)
the buttons add and remove disappear
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There is something missing about the usage of the jquery plugin. I do not see the 'add' and remove' buttons added to the html at my end.
The jquery add and remove buttons works only if there set a context['formset'] name. I do not know why. Maybe django 2 version or needs change the class Formset(LayoutObject)
So its works:
forms.py:
Fieldset(
'Add videos',
Formset('formset'),
),
views:
context['formset'] = PostVideoFormSet( self.request.POST, instance=self.object)
but if change this name to:
Fieldset(
'Add videos',
Formset('videos'),
),
and context['videos'] = PostVideoFormSet( self.request.POST, instance=self.object)
the buttons add and remove disappear