code: def modelresource_factory(model, resource_class=ModelResource):
      
      attrs = {'model': model}
      Meta = type(str('Meta'), (object,), attrs)
  
      class_name = model.__name__ + str('Resource')
  
      class_attrs = {
          'Meta': Meta,
      }
  
      metaclass = ModelDeclarativeMetaclass
      return metaclass(class_name, (resource_class,), class_attrs)
docs: Factory for creating ``ModelResource`` class for given Django model.