code: def add_or_update(uid, post_data):
          '''
          Add or update the post.
          '''
          cur_rec = MPost.get_by_uid(uid)
          if cur_rec:
              MPost.update(uid, post_data)
          else:
              MPost.create_post(uid, post_dataf add_or_update(uid, post_data):
          '''
          Add or update the post.
          '''
          cur_rec = MPost.get_by_uid(uid)
          if cur_rec:
              MPost.update(uid, post_data)
          else:
              MPost.create_post(uid, post_data)
docs: Add or update the post.