code: def save_model(self, name, datapackage_url, datapackage,
                     model, dataset_name, author, status, loaded):
          
          document = {
              # Fields used by babbage API
              'id': name,
              'model': model,
              'package': datapackage,
              'origin_url': datapackage_url,
  
              # Extra fields available in search
              'dataset': dataset_name,
              'author': author,
              'loading_status': status,
              'loaded': loaded,
              'last_update': time.time()
          }
          self.es.index(index=self.index_name, doc_type=self.DOC_TYPE,
                        body=document, id=name)
          # Make sure that the data is saved
          self.es.indices.flush(self.index_name)
docs: Save a model in the registry
          :param name: name for the model
          :param datapackage_url: origin URL for the datapackage which is the
              source for this model
          :param datapackage: datapackage object from which this model was
              derived
          :param dataset_name: Title of the dataset
          :param author: Author of the dataset
          :param model: model to save
          :param status: What's the status for loading
          :param loaded: Was the package loaded successfully