def get_context_data(self, **kwargs): context = super(CreatorCreate, self).get_context_data(**kwargs) if self.request.POST: context["attribution"] = AttributionFormSet(self.request.POST) else: context["attribution"] = AttributionFormSet() return context
def get_context_data(self, **kwargs): context = super(TeamCreate, self).get_context_data(**kwargs) context["title"] = "Add Team" if self.request.POST: context["attribution"] = AttributionFormSet(self.request.POST) else: context["attribution"] = AttributionFormSet() return context
def get_context_data(self, **kwargs): context = super(TeamUpdate, self).get_context_data(**kwargs) context["title"] = f"Edit information for {context['team']}" if self.request.POST: context["attribution"] = AttributionFormSet( self.request.POST, instance=self.object, queryset=(Attribution.objects.filter(teams=self.object)), prefix="attribution", ) context["attribution"].full_clean() else: context["attribution"] = AttributionFormSet( instance=self.object, queryset=(Attribution.objects.filter(teams=self.object)), prefix="attribution", ) return context
def get_context_data(self, **kwargs): context = super(CreatorUpdate, self).get_context_data(**kwargs) context["title"] = "Edit Creator Information" if self.request.POST: context["attribution"] = AttributionFormSet( self.request.POST, instance=self.object, queryset=(Attribution.objects.filter(creators=self.object)), prefix="attribution", ) context["attribution"].full_clean() else: context["attribution"] = AttributionFormSet( instance=self.object, queryset=(Attribution.objects.filter(creators=self.object)), prefix="attribution", ) return context