code: def construct_formset(self):
          
          if not self.inline_model or not self.parent_model:
              msg = "Parent and Inline models are required in {}".format(self.__class__.__name__)
              raise NotModelException(msg)
  
          return inlineformset_factory(
              self.parent_model,
              self.inline_model,
              **self.get_factory_kwargs())
docs: Returns an instance of the inline formset