original_docstring: 
          Efficiently adds tags to batches (in one query).
  
          This method requires that the batches have not been tagged yet with the list of tag
          names supplied.
  
          :param batch_to_tags: a dictionnary from batch ids to the new tag ids they should have.
          
docstring: Efficiently adds tags to batches (in one query).
  This method requires that the batches have not been tagged yet with the list of tag
  names supplied.
docstring_tokens: Efficiently adds tags to batches ( in one query ) . This method requires that the batches have not been tagged yet with the list of tag names supplied .
code: def add_tags_to_batches(cls, batch_to_tags):
          """
          Efficiently adds tags to batches (in one query).
  
          This method requires that the batches have not been tagged yet with the list of tag
          names supplied.
  
          :param batch_to_tags: a dictionnary from batch ids to the new tag ids they should have.
          """
          ThroughModel = cls.batches.through
  
          instances = []
          for batch_id, tags in batch_to_tags.items():
              for tag in tags:
                  instances.append(ThroughModel(tag_id=tag, batch_id=batch_id))
  
          ThroughModel.objects.bulk_create(instances)
code_tokens: def add_tags_to_batches ( cls , batch_to_tags ) : ThroughModel = cls . batches . through instances = [ ] for batch_id , tags in batch_to_tags . items ( ) : for tag in tags : instances . append ( ThroughModel ( tag_id = tag , batch_id = batch_id ) ) ThroughModel . objects . bulk_create ( instances )
short_docstring: Efficiently adds tags to batches (in one query).
short_docstring_tokens: Efficiently adds tags to batches ( in one query ) .
comment: """
          Efficiently adds tags to batches (in one query).
  
          This method requires that the batches have not been tagged yet with the list of tag
          names supplied.
  
          :param batch_to_tags: a dictionnary from batch ids to the new tag ids they should have.
          """