code: def add_or_update(uid, post_data):
          '''
          Add or update the data by the given ID of post.
          '''
          catinfo = MCategory.get_by_uid(uid)
          if catinfo:
              MCategory.update(uid, post_data)
          else:
              TabTag.create(
                  uid=uid,
                  name=post_data['name'],
                  slug=post_data['slug'],
                  order=post_data['order'],
                  kind=post_data['kind'] if 'kind' in post_data else '1',
                  pid=post_data['pid'],
              )
          return uif add_or_update(uid, post_data):
          '''
          Add or update the data by the given ID of post.
          '''
          catinfo = MCategory.get_by_uid(uid)
          if catinfo:
              MCategory.update(uid, post_data)
          else:
              TabTag.create(
                  uid=uid,
                  name=post_data['name'],
                  slug=post_data['slug'],
                  order=post_data['order'],
                  kind=post_data['kind'] if 'kind' in post_data else '1',
                  pid=post_data['pid'],
              )
          return uid
docs: Add or update the data by the given ID of post.