docs: def ensure(self, status, cost):
          """
          ensure link properties correspond to the specified ones
          perform save operation only if necessary
          """
          changed = False
          status_id = LINK_STATUS[status]
          if self.status != status_id:
              self.status = status_id
              changed = True
          if self.metric_value != cost:
              self.metric_value = cost
              changed = True
          if changed:
              self.save()