From 590c2b101de10d303267ff13681b383405c49b5c Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Sun, 7 Apr 2019 23:31:47 -0300 Subject: [PATCH] =?UTF-8?q?add=20a=C3=A7=C3=A3o=20para=20recuperar=20mat?= =?UTF-8?q?=20anexadas=20de=20uma=20mat=C3=A9ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/api/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sapl/api/views.py b/sapl/api/views.py index ceff4ccd7..a8f6f3349 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -400,6 +400,11 @@ class _MateriaLegislativaViewSet: return Response(serializer_class.data) + @action(detail=True, methods=['GET']) + def anexadas(self, request, *args, **kwargs): + self.queryset = self.get_object().anexadas.all() + return self.list(request, *args, **kwargs) + @customize(TipoMateriaLegislativa) class _TipoMateriaLegislativaViewSet: