From 77513ad63bf104e9797cd24b233f230bd6e387df Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Sat, 26 Dec 2015 18:54:45 -0200 Subject: [PATCH] fix qa_check --- compilacao/forms.py | 11 +++++------ compilacao/templatetags/compilacao_filters.py | 1 - compilacao/urls.py | 3 --- compilacao/utils.py | 5 +---- compilacao/views.py | 17 +++++------------ compilacao/views2.py | 16 ++++++---------- materia/urls.py | 12 +++++------- materia/views.py | 5 ++--- norma/urls.py | 8 ++------ norma/views.py | 4 +--- sapl/settings.py | 2 +- sessao/views.py | 1 - 12 files changed, 28 insertions(+), 57 deletions(-) diff --git a/compilacao/forms.py b/compilacao/forms.py index 606691d28..1c6f59762 100644 --- a/compilacao/forms.py +++ b/compilacao/forms.py @@ -2,18 +2,17 @@ from crispy_forms.helper import FormHelper from crispy_forms_foundation.layout import (HTML, Column, Div, Fieldset, Layout, Row, Submit) -from crispy_forms_foundation.layout.buttons import Button, ButtonHolder +from crispy_forms_foundation.layout.buttons import Button from crispy_forms_foundation.layout.fields import Field from django import forms from django.core.exceptions import NON_FIELD_ERRORS from django.forms.models import ModelForm from django.utils.translation import ugettext_lazy as _ -from compilacao import utils, models -from compilacao.models import Dispositivo, Nota, TipoNota, TipoVide, Vide,\ - TextoArticulado, TipoTextoArticulado -from compilacao.utils import to_row, to_column, to_fieldsets -from norma.models import TipoNormaJuridica +from compilacao import models +from compilacao.models import (Dispositivo, Nota, TextoArticulado, TipoNota, + TipoTextoArticulado, TipoVide, Vide) +from compilacao.utils import to_column, to_fieldsets, to_row class UpLoadImportFileForm(forms.Form): diff --git a/compilacao/templatetags/compilacao_filters.py b/compilacao/templatetags/compilacao_filters.py index 3934d7705..61e7353b2 100644 --- a/compilacao/templatetags/compilacao_filters.py +++ b/compilacao/templatetags/compilacao_filters.py @@ -154,7 +154,6 @@ def nomenclatura_heranca(d, ignore_ultimo=0, ignore_primeiro=0): return result - @register.simple_tag def verbose_name(instance, field_name): return instance._meta.get_field(field_name).verbose_name.title() diff --git a/compilacao/urls.py b/compilacao/urls.py index 109e7583a..933fcfebb 100644 --- a/compilacao/urls.py +++ b/compilacao/urls.py @@ -59,9 +59,6 @@ urlpatterns = [ """ - - - url(r'^(?P[0-9]+)/compilacao/(?P[0-9]+)/refresh', views.DispositivoEditView.as_view(), name='dispositivo_edit'), diff --git a/compilacao/utils.py b/compilacao/utils.py index b5a494ed8..244b27d55 100644 --- a/compilacao/utils.py +++ b/compilacao/utils.py @@ -1,7 +1,4 @@ -from crispy_forms_foundation.layout import (HTML, Column, Div, Fieldset, - Layout, Row, Submit) -from django.apps import apps -from django.contrib import admin +from crispy_forms_foundation.layout import Column, Fieldset, Row from django.utils.translation import ugettext_lazy as _ diff --git a/compilacao/views.py b/compilacao/views.py index a98be81e2..210aeb301 100644 --- a/compilacao/views.py +++ b/compilacao/views.py @@ -1,33 +1,26 @@ from collections import OrderedDict from datetime import datetime, timedelta -from os.path import sys from braces.views import FormMessagesMixin from django.contrib.auth.decorators import login_required -from django.contrib.messages.api import success from django.core.signing import Signer from django.core.urlresolvers import reverse, reverse_lazy from django.db.models import Q -from django.http.response import (HttpResponse, HttpResponseRedirect, - JsonResponse) -from django.shortcuts import get_object_or_404, render +from django.http.response import HttpResponse, HttpResponseRedirect +from django.shortcuts import get_object_or_404 from django.utils.dateparse import parse_date from django.utils.decorators import method_decorator -from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import TemplateView from django.views.generic.detail import DetailView -from django.views.generic.edit import FormMixin, UpdateView, CreateView,\ - DeleteView +from django.views.generic.edit import CreateView, DeleteView, UpdateView from django.views.generic.list import ListView from compilacao import forms, utils from compilacao.models import (Dispositivo, Nota, PerfilEstruturalTextoArticulado, - TipoDispositivo, TipoNota, TipoPublicacao, - TipoVide, VeiculoPublicacao, Vide, - TextoArticulado) - + TextoArticulado, TipoDispositivo, TipoNota, + Vide) DISPOSITIVO_SELECT_RELATED = ( 'tipo_dispositivo', diff --git a/compilacao/views2.py b/compilacao/views2.py index 5afd1a3a0..33a90fd01 100644 --- a/compilacao/views2.py +++ b/compilacao/views2.py @@ -2,26 +2,22 @@ from collections import OrderedDict from datetime import datetime, timedelta from os.path import sys -from django.contrib.auth.decorators import login_required from django.core.signing import Signer -from django.core.urlresolvers import reverse from django.db.models import Q -from django.http.response import (HttpResponse, HttpResponseRedirect, - JsonResponse) -from django.shortcuts import get_object_or_404, render +from django.http.response import JsonResponse +from django.shortcuts import render from django.utils.dateparse import parse_date -from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import TemplateView -from django.views.generic.edit import FormMixin, UpdateView, CreateView +from django.views.generic.edit import FormMixin from django.views.generic.list import ListView from compilacao import forms from compilacao.models import (Dispositivo, Nota, PerfilEstruturalTextoArticulado, - TipoDispositivo, TipoNota, TipoPublicacao, - TipoVide, VeiculoPublicacao, Vide, - TextoArticulado) + TextoArticulado, TipoDispositivo, TipoNota, + TipoPublicacao, TipoVide, VeiculoPublicacao, + Vide) from sapl.crud import build_crud DISPOSITIVO_SELECT_RELATED = ( diff --git a/materia/urls.py b/materia/urls.py index 7876a613d..5768a807e 100644 --- a/materia/urls.py +++ b/materia/urls.py @@ -6,18 +6,16 @@ from materia.views import (AutoriaEditView, AutoriaView, FormularioCadastroView, FormularioSimplificadoView, LegislacaoCitadaEditView, LegislacaoCitadaView, MateriaAnexadaEditView, MateriaAnexadaView, - MateriaLegislativaPesquisaView, NumeracaoEditView, - NumeracaoView, PesquisaMateriaListView, - ProposicaoListView, ProposicaoView, - RelatoriaEditView, RelatoriaView, + MateriaLegislativaPesquisaView, MateriaTaView, + NumeracaoEditView, NumeracaoView, + PesquisaMateriaListView, ProposicaoListView, + ProposicaoView, RelatoriaEditView, RelatoriaView, TramitacaoEditView, TramitacaoView, autor_crud, materia_legislativa_crud, orgao_crud, origem_crud, regime_tramitacao_crud, status_tramitacao_crud, tipo_autor_crud, tipo_documento_crud, tipo_fim_relatoria_crud, tipo_materia_crud, - tipo_proposicao_crud, unidade_tramitacao_crud, - MateriaTaView) - + tipo_proposicao_crud, unidade_tramitacao_crud) materia_legislativa_patterns = materia_legislativa_crud.urlpatterns diff --git a/materia/views.py b/materia/views.py index 4026f85a5..aa21a2375 100644 --- a/materia/views.py +++ b/materia/views.py @@ -8,7 +8,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse, reverse_lazy from django.forms import ModelForm -from django.shortcuts import redirect, get_object_or_404 +from django.shortcuts import get_object_or_404, redirect from django.utils.html import strip_tags from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ @@ -16,12 +16,12 @@ from django.views.generic import ListView from django.views.generic.edit import FormMixin from vanilla import GenericView +import sapl from comissoes.models import Comissao, Composicao from compilacao.models import TextoArticulado, TipoTextoArticulado from norma.models import LegislacaoCitada, NormaJuridica, TipoNormaJuridica from parlamentares.models import Parlamentar from sapl.crud import build_crud -import sapl from .models import (Anexada, Autor, Autoria, DespachoInicial, DocumentoAcessorio, MateriaLegislativa, Numeracao, Orgao, @@ -30,7 +30,6 @@ from .models import (Anexada, Autor, Autoria, DespachoInicial, TipoFimRelatoria, TipoMateriaLegislativa, TipoProposicao, Tramitacao, UnidadeTramitacao) - origem_crud = build_crud( Origem, 'origem', [ diff --git a/norma/urls.py b/norma/urls.py index a63322ad3..862e535ed 100644 --- a/norma/urls.py +++ b/norma/urls.py @@ -1,11 +1,7 @@ from django.conf.urls import include, url -from compilacao.urls import urlpatterns as __url__compilacao,\ - urlpatterns_compilacao -from norma.views import (NormaIncluirView, assunto_norma_crud, - norma_temporario_crud, tipo_norma_crud, - NormaTaView) - +from norma.views import (NormaIncluirView, NormaTaView, assunto_norma_crud, + norma_temporario_crud, tipo_norma_crud) norma_url_patterns = norma_temporario_crud.urlpatterns # norma_url_patterns = norma_crud.urlpatterns + [] diff --git a/norma/views.py b/norma/views.py index 3ed76f691..90717e21a 100644 --- a/norma/views.py +++ b/norma/views.py @@ -12,19 +12,17 @@ from django.shortcuts import get_object_or_404, redirect from django.utils.html import strip_tags from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ -from django.views.generic.base import RedirectView from django.views.generic.edit import FormMixin from vanilla import GenericView +import sapl from compilacao.models import TextoArticulado, TipoTextoArticulado from materia.models import MateriaLegislativa, TipoMateriaLegislativa from sapl.crud import build_crud -import sapl from .models import (AssuntoNorma, LegislacaoCitada, NormaJuridica, TipoNormaJuridica) - assunto_norma_crud = build_crud( AssuntoNorma, 'assunto_norma_juridica', [ diff --git a/sapl/settings.py b/sapl/settings.py index 18ec530fa..cc0b6ed57 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -105,7 +105,7 @@ WSGI_APPLICATION = 'sapl.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'sapl_temp2_compilacao', + 'NAME': 'sapl', 'USER': 'sapl', 'PASSWORD': 'sapl', 'HOST': 'localhost', diff --git a/sessao/views.py b/sessao/views.py index 275def8df..0193d31a1 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -25,7 +25,6 @@ from .models import (CargoMesa, ExpedienteMateria, ExpedienteSessao, TipoExpediente, TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar) - tipo_sessao_crud = build_crud( TipoSessaoPlenaria, 'tipo_sessao_plenaria', [