Esempio n. 1
0
 def get_context_data(self, **kwargs):
     """Context with inline formsets."""
     data = super(DocumentCreateView, self).get_context_data(**kwargs)
     if self.request.POST:
         data['formset'] = cons_forms.FileAttachmentFormSet(
             self.request.POST)
     else:
         data['formset'] = cons_forms.FileAttachmentFormSet()
     data["formset_helper"] = cons_forms.FileAttachmentFormSetHelper()
     return data
Esempio n. 2
0
 def get_context_data(self, **kwargs):
     """Context with inline formsets."""
     data = super(ConservationActivityUpdateView,
                  self).get_context_data(**kwargs)
     if self.request.POST:
         data['formset'] = cons_forms.FileAttachmentFormSet(
             self.request.POST, instance=self.object)
     else:
         data['formset'] = cons_forms.FileAttachmentFormSet(
             instance=self.object)
     data["formset_helper"] = cons_forms.FileAttachmentFormSetHelper()
     return data