djdb/tag_util.py
def add_tag_and_save(user, obj, new_tag, insert=False):
    """Adds a single tag to an object, and save to the datastore.

    Args:
      user: The User object of the person responsible for this change
        to the tags.
      obj: The object (either an Album or a Track) containing the tags.
      new_tag: A single item to add to the object's list of tags.
      insert: Whether to insert a new tag entity into the datastore.

    Returns:
      True if a modified version of the object was saved, or False if
      no changes were necessary.
    """
    if insert and AutoRetry(models.Tag.all().filter("name =", new_tag)).count() == 0:
        tag = models.Tag(name=new_tag)
        AutoRetry(tag).put()
        
    return modify_tags_and_save(user, obj, [new_tag], [])
Adds a single tag to an object, and save to the datastore.

    Args:
      user: The User object of the person responsible for this change
        to the tags.
      obj: The object (either an Album or a Track) containing the tags.
      new_tag: A single item to add to the object's list of tags.
      insert: Whether to insert a new tag entity into the datastore.

    Returns:
      True if a modified version of the object was saved, or False if
      no changes were necessary.
    
Adds a single tag to an object, and save to the datastore.
Adds a single tag to an object and save to the datastore .
def add_tag_and_save(user, obj, new_tag, insert=False):
    if insert and AutoRetry(models.Tag.all().filter("name =", new_tag)).count() == 0:
        tag = models.Tag(name=new_tag)
        AutoRetry(tag).put()
    return modify_tags_and_save(user, obj, [new_tag], [])
def add_tag_and_save ( user , obj , new_tag , insert = False ) : if insert and AutoRetry ( models . Tag . all ( ) . filter ( "name =" , new_tag ) ) . count ( ) == 0 : tag = models . Tag ( name = new_tag ) AutoRetry ( tag ) . put ( ) return modify_tags_and_save ( user , obj , [ new_tag ] , [ ] )
Adds a single tag to an object, and save to the datastore.
Adds a single tag to an object and save to the datastore .
"""Adds a single tag to an object, and save to the datastore.

    Args:
      user: The User object of the person responsible for this change
        to the tags.
      obj: The object (either an Album or a Track) containing the tags.
      new_tag: A single item to add to the object's list of tags.
      insert: Whether to insert a new tag entity into the datastore.

    Returns:
      True if a modified version of the object was saved, or False if
      no changes were necessary.
    """
True if a modified version of the object was saved, or False if
no changes were necessary.
True if a modified version of the object was saved or False if no changes were necessary .
user
The User object of the person responsible for this change
to the tags.
The User object of the person responsible for this change to the tags .
obj
The object (either an Album or a Track) containing the tags.
The object ( either an Album or a Track ) containing the tags .
new_tag
A single item to add to the object's list of tags.
A single item to add to the object ' s list of tags .
insert
Whether to insert a new tag entity into the datastore.
Whether to insert a new tag entity into the datastore .