code: def get_staff_url(self):
          
          object = self.get_staff_object()
          if object is not None:
              # View is likely using SingleObjectMixin
              return reverse(admin_urlname(object._meta, 'change'), args=(object.pk,))
  
          model = _get_view_model(self)
          if model is not None:
              # View is likely using MultipleObjectMixin (e.g. ListView)
              return reverse(admin_urlname(object._meta, 'changelist'))
  
          return None
docs: Return the Admin URL for the current view.
          By default, it uses the :func:`get_staff_object` function to base the URL on.