code: def get_model_and_form_class(model, form_class):
      
      if form_class:
          return form_class._meta.model, form_class
      if model:
          # The inner Meta class fails if model = model is used for some reason.
          tmp_model = model
          # TODO: we should be able to construct a ModelForm without creating
          # and passing in a temporary inner class.
  
          class Meta:
              model = tmp_model
  
          class_name = model.__name__ + 'Form'
          form_class = ModelFormMetaclass(
              class_name, (ModelForm,), {'Meta': Meta})
          return model, form_class
      raise GenericViewError("Generic view must be called with either a model or"
                             " form_class argument.")
docs: Returns a model and form class based on the model and form_class
      parameters that were passed to the generic view.
  
      If ``form_class`` is given then its associated model will be returned along
      with ``form_class`` itself.  Otherwise, if ``model`` is given, ``model``
      itself will be returned along with a ``ModelForm`` class created from
      ``model``.