code: def add_record(post_id, tag_name, order=1, kind='z'):
          '''
          Add the record.
          '''
          logger.info('Add label kind: {0}'.format(kind))
          tag_id = MLabel.get_id_by_name(tag_name, 'z')
          labelinfo = MPost2Label.get_by_info(post_id, tag_id)
          if labelinfo:
              entry = TabPost2Tag.update(
                  order=order,
              ).where(TabPost2Tag.uid == labelinfo.uid)
              entry.execute()
          else:
              entry = TabPost2Tag.create(
                  uid=tools.get_uuid(),
                  post_id=post_id,
                  tag_id=tag_id,
                  order=order,
                  kind='z')
              return entry.uif add_record(post_id, tag_name, order=1, kind='z'):
          '''
          Add the record.
          '''
          logger.info('Add label kind: {0}'.format(kind))
          tag_id = MLabel.get_id_by_name(tag_name, 'z')
          labelinfo = MPost2Label.get_by_info(post_id, tag_id)
          if labelinfo:
              entry = TabPost2Tag.update(
                  order=order,
              ).where(TabPost2Tag.uid == labelinfo.uid)
              entry.execute()
          else:
              entry = TabPost2Tag.create(
                  uid=tools.get_uuid(),
                  post_id=post_id,
                  tag_id=tag_id,
                  order=order,
                  kind='z')
              return entry.uid
docs: Add the record.