From 988f2bab9e02e230ba1d9b0a4bbaa46545492abf 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 1cfdd1d44..2eedb9464 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -401,6 +401,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: