diff --git a/apis_core/generic/abc.py b/apis_core/generic/abc.py index 4cf185c09..70295598a 100644 --- a/apis_core/generic/abc.py +++ b/apis_core/generic/abc.py @@ -7,7 +7,7 @@ from django.forms import model_to_dict from django.urls import reverse -from apis_core.generic.helpers import permission_fullname +from apis_core.generic.helpers import mro_paths, permission_fullname from apis_core.generic.signals import ( post_duplicate, post_merge_with, @@ -39,6 +39,10 @@ def get_importview_url(cls): ct = ContentType.objects.get_for_model(cls) return reverse("apis_core:generic:import", args=[ct]) + @classmethod + def get_openapi_tags(cls): + return [item[-1] for item in mro_paths(cls)] + def get_edit_url(self): ct = ContentType.objects.get_for_model(self) return reverse("apis_core:generic:update", args=[ct, self.id])