code: def tag_helper(tag, items, locked=True, remove=False):
      
      if not isinstance(items, list):
          items = [items]
      data = {}
      if not remove:
          for i, item in enumerate(items):
              tagname = '%s[%s].tag.tag' % (tag, i)
              data[tagname] = item
      if remove:
          tagname = '%s[].tag.tag-' % tag
          data[tagname] = ','.join(items)
      data['%s.locked' % tag] = 1 if locked else 0
      return data
docs: Simple tag helper for editing a object.