From 28c9c4dc09e4e847f4b2654a52efd7935448dc3e Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 15 Sep 2016 14:53:00 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20pesquisar=20autor=20no=20formul?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/materia/views.py | 3 ++- sapl/templates/materia/acessorio_lote.html | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 4541c9c07..d396e6545 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1277,6 +1277,7 @@ class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): return self.get(request, self.kwargs) tipo = TipoDocumento.objects.get(descricao=request.POST['tipo']) + for materia_id in marcadas: DocumentoAcessorio.objects.create( materia_id=materia_id, @@ -1284,7 +1285,7 @@ class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): arquivo=request.POST['arquivo'], nome=request.POST['nome'], data=datetime.strptime(request.POST['data'], "%d/%m/%Y"), - autor=request.POST['autor'], + autor=Autor.objects.get(id=request.POST['autor']), ementa=request.POST['ementa'] ) msg = _('Documento(s) criado(s).') diff --git a/sapl/templates/materia/acessorio_lote.html b/sapl/templates/materia/acessorio_lote.html index 77adfb4e4..5b4528bca 100644 --- a/sapl/templates/materia/acessorio_lote.html +++ b/sapl/templates/materia/acessorio_lote.html @@ -43,8 +43,20 @@
- - + + +
+ + + +
+
+
+