code: def _get_model_name(self, modeldata):
          
          if 'change_url' in modeldata:
              return modeldata['change_url'].strip('/').split('/')[-1]   # /foo/admin/appname/modelname
          elif 'add_url' in modeldata:
              return modeldata['add_url'].strip('/').split('/')[-2]      # /foo/admin/appname/modelname/add
          else:
              raise ValueError("Missing attributes in modeldata to find the model name!")
docs: Extract the model name from the ``modeldata`` that *django-admin-tools* provides.