def tag_string_convert(key, data, errors, context):
 if isinstance(data[key], basestring):
  tags = [tag.strip() for tag in data[key].split(',') if tag.strip()]
 else:
  tags = data[key]
 current_index = max(([int(k[1]) for k in data.keys() if ((len(k) == 3) and (k[0] == 'tags'))] + [(-1)]))
 for (num, tag) in zip(count((current_index + 1)), tags):
  data[('tags', num, 'name')] = tag
 for tag in tags:
  tag_length_validator(tag, context)
  tag_name_validator(tag, context)

def tag_string_convert ( key , data , errors , context ) : if isinstance ( data [ key ] , basestring ) : tags = [ tag . strip ( ) for tag in data [ key ] . split ( ',' ) if tag . strip ( ) ] else : tags = data [ key ] current_index = max ( ( [ int ( k [ 1 ] ) for k in data . keys ( ) if ( ( len ( k ) == 3 ) and ( k [ 0 ] == 'tags' ) ) ] + [ ( - 1 ) ] ) ) for ( num , tag ) in zip ( count ( ( current_index + 1 ) ) , tags ) : data [ ( 'tags' , num , 'name' ) ] = tag for tag in tags : tag_length_validator ( tag , context ) tag_name_validator ( tag , context )
takes a list of tags that is a comma-separated string and parses tag names .