diff --git a/apis_core/generic/abc.py b/apis_core/generic/abc.py index 2f24f4a3c..72d500aa2 100644 --- a/apis_core/generic/abc.py +++ b/apis_core/generic/abc.py @@ -16,6 +16,11 @@ def get_createview_url(cls): ct = ContentType.objects.get_for_model(cls) return reverse("apis_core:generic:create", args=[ct]) + @classmethod + def get_importview_url(cls): + ct = ContentType.objects.get_for_model(cls) + return reverse("apis_core:generic:import", args=[ct]) + def get_edit_url(self): ct = ContentType.objects.get_for_model(self) return reverse("apis_core:generic:update", args=[ct, self.id]) diff --git a/apis_core/generic/templates/generic/generic_list.html b/apis_core/generic/templates/generic/generic_list.html index 28b9976f0..ce5c46f24 100644 --- a/apis_core/generic/templates/generic/generic_list.html +++ b/apis_core/generic/templates/generic/generic_list.html @@ -14,6 +14,8 @@ {% if object_list.model.get_add_permission in perms %} Create + Import {% endif %}