Make a django parent model accessible to formset without displaying it in html

I have page1 with two links (‘A’ and ‘B’) on it the specific link that is clicked determines a query parameter /page2/?q=A or /page2/?q=B . On page 2 the user completes an inline formset, the parent form of which has been set to avalue of ‘A’ or ‘B’ depending on the link clicked on the previous page.

I do not want to display the parent form but if this is not displayed then I am unable to successfully save the formset and parent form.

The for page 2 is:

class CaseView(TemplateView):
    model = Case
    template_name = “page2/page2.html”
    def get(self, *args, **kwargs):
       # parent form
        case_form = CaseForm
        case_form = CaseForm(initial={'pharm_class_name': p})
       # child formset
        sideeffect_formset = SideeffectFormSet(queryset=SideEffect.objects.none())

        return self.render_to_response(
            { "case_form": case_form,
              "sideeffect_formset": sideeffect_formset,
              "sideeffect_formsethelper": SideEffectFormSetSetHelper,

    def post(self, *args, **kwargs):
        form = CaseForm(data=self.request.POST)
        sideeffect_formset = SideeffectFormSet(data=self.request.POST)
        if form.is_valid():
            case_instance =
            if self.request.user.is_authenticated:
                case_instance.user = self.request.user
        if sideeffect_formset.is_valid():
            sideeffect_name =
            for sideeffect in sideeffect_name:
       = case_instance
            return redirect(
                    kwargs={"case_id": case_instance.case_id},

I want to be able to save CaseForm and have it available for the childformset without actually displaying CaseForm in the html

If the form is not being displayed, why do you want to save it?

You’ve got a reference to a model, that’s all you need to be able to save the formset relating to that model.

Thanks @KenWhitesell had managed to confuse myself, as you suggest just creating a model instance with the query parameter fixed it