code: def delete_by_id(self, del_id):
          '''
          Delete a link by id.
          '''
          if self.check_post_role()['DELETE']:
              pass
          else:
              return False
          if self.is_p:
              if MLink.delete(del_id):
                  output = {'del_link': 1}
              else:
                  output = {'del_link': 0}
              return json.dump(output, self)
          else:
              is_deleted = MLink.delete(del_id)
              if is_deleted:
                  self.redirect('/link/list'f delete_by_id(self, del_id):
          '''
          Delete a link by id.
          '''
          if self.check_post_role()['DELETE']:
              pass
          else:
              return False
          if self.is_p:
              if MLink.delete(del_id):
                  output = {'del_link': 1}
              else:
                  output = {'del_link': 0}
              return json.dump(output, self)
          else:
              is_deleted = MLink.delete(del_id)
              if is_deleted:
                  self.redirect('/link/list')
docs: Delete a link by id.