parameters: (model, tag_descriptor_attr='tags',
               tagged_item_manager_attr='tagged')
docstring: Sets the given model class up for working with tags.
docstring_summary: Sets the given model class up for working with tags.
docstring_tokens: Sets the given model class up for working with tags .
function: def register(model, tag_descriptor_attr='tags',
               tagged_item_manager_attr='tagged'):
      """
      Sets the given model class up for working with tags.
      """
      if model in registry:
          raise AlreadyRegistered(
              _('The model %s has already been registered.') % model.__name__)
      registry.append(model)
  
      # Add tag descriptor
      setattr(model, tag_descriptor_attr, TagDescriptor())
  
      # Add custom manager
      ModelTaggedItemManager().contribute_to_class(model,
                                                   tagged_item_manager_attr)
function_tokens: def register ( model , tag_descriptor_attr = 'tags' , tagged_item_manager_attr = 'tagged' ) : if model in registry : raise AlreadyRegistered ( _ ( 'The model %s has already been registered.' ) % model . __name__ ) registry . append ( model ) # Add tag descriptor setattr ( model , tag_descriptor_attr , TagDescriptor ( ) ) # Add custom manager ModelTaggedItemManager ( ) . contribute_to_class ( model , tagged_item_manager_attr )