def get_model_and_form_class(model, form_class):
 if form_class:
  return (form_class._meta.model, form_class)
 if model:
  tmp_model = model
  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.')

def get_model_and_form_class ( model , form_class ) : if form_class : return ( form_class . _meta . model , form_class ) if model : tmp_model = model 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.' )
returns a model and form class based on the model and form_class parameters that were passed to the generic view .