Browse Source

Corrige erros de pep8

pull/588/merge
LeandroRoberto 8 years ago
parent
commit
62f4ff9534
  1. 1
      sapl/base/models.py
  2. 5
      sapl/base/urls.py
  3. 9
      sapl/compilacao/forms.py
  4. 1
      sapl/compilacao/templatetags/compilacao_filters.py
  5. 4
      sapl/compilacao/urls.py
  6. 40
      sapl/compilacao/views.py
  7. 1
      sapl/materia/admin.py
  8. 1
      sapl/materia/views.py
  9. 3
      sapl/protocoloadm/views.py

1
sapl/base/models.py

@ -5,7 +5,6 @@ from django.utils.translation import ugettext_lazy as _
from sapl.utils import UF, YES_NO_CHOICES from sapl.utils import UF, YES_NO_CHOICES
TIPO_DOCUMENTO_ADMINISTRATIVO = (('O', _('Ostensivo')), TIPO_DOCUMENTO_ADMINISTRATIVO = (('O', _('Ostensivo')),
('R', _('Restritivo'))) ('R', _('Restritivo')))

5
sapl/base/urls.py

@ -4,9 +4,8 @@ from django.views.generic.base import TemplateView
from .apps import AppConfig from .apps import AppConfig
from .forms import LoginForm from .forms import LoginForm
from .views import (AppConfigCrud, from .views import (AppConfigCrud, CasaLegislativaCrud, HelpView,
CasaLegislativaCrud, HelpView, RelatorioAtasView, RelatorioAtasView, RelatorioHistoricoTramitacaoView,
RelatorioHistoricoTramitacaoView,
RelatorioMateriasPorAnoAutorTipoView, RelatorioMateriasPorAnoAutorTipoView,
RelatorioMateriasPorAutorView, RelatorioMateriasPorAutorView,
RelatorioMateriasTramitacaoView, RelatorioMateriasTramitacaoView,

9
sapl/compilacao/forms.py

@ -734,7 +734,9 @@ class DispositivoSearchModalForm(Form):
placeholder=_('Digite palavras, letras, ' placeholder=_('Digite palavras, letras, '
'números ou algo' 'números ou algo'
' que estejam no texto.')), ' que estejam no texto.')),
StrictButton(_('Buscar'), css_class='btn-busca btn-primary')), 7)) StrictButton(
_('Buscar'),
css_class='btn-busca btn-primary')), 7))
) )
) )
@ -1278,8 +1280,3 @@ class DispositivoRegistroAlteracaoForm(Form):
super(DispositivoRegistroAlteracaoForm, self).__init__(*args, **kwargs) super(DispositivoRegistroAlteracaoForm, self).__init__(*args, **kwargs)
self.fields['dispositivo_alterado'].choices = [] self.fields['dispositivo_alterado'].choices = []
def save(self):
super(DispositivoRegistroAlteracaoForm, self).save()
data = self.cleaned_data

1
sapl/compilacao/templatetags/compilacao_filters.py

@ -7,7 +7,6 @@ from django.utils.translation import ugettext_lazy as _
from sapl.compilacao.models import Dispositivo from sapl.compilacao.models import Dispositivo
register = template.Library() register = template.Library()

4
sapl/compilacao/urls.py

@ -109,7 +109,6 @@ urlpatterns_compilacao = [
url(r'^config/tipo-textoarticulado/(?P<pk>[0-9]+)/delete$', url(r'^config/tipo-textoarticulado/(?P<pk>[0-9]+)/delete$',
views.TipoTaDeleteView.as_view(), name='tipo_ta_delete'), views.TipoTaDeleteView.as_view(), name='tipo_ta_delete'),
] ]
urlpatterns = [ urlpatterns = [
@ -125,6 +124,3 @@ urlpatterns = [
include(VeiculoPublicacaoCrud.get_urls())), include(VeiculoPublicacaoCrud.get_urls())),
] ]
"""url(r'^(?P<ta_id>[0-9]+)/text/(?P<dispositivo_id>[0-9]+)/actions',
views.ActionsEditView.as_view(), name='dispositivo_actions'),"""

40
sapl/compilacao/views.py

@ -1,6 +1,6 @@
import sys
from collections import OrderedDict from collections import OrderedDict
from datetime import datetime, timedelta from datetime import datetime, timedelta
import sys
from braces.views import FormMessagesMixin from braces.views import FormMessagesMixin
from django import forms from django import forms
@ -23,30 +23,28 @@ from django.views.generic.edit import (CreateView, DeleteView, FormView,
UpdateView) UpdateView)
from django.views.generic.list import ListView from django.views.generic.list import ListView
from sapl.compilacao.forms import ( from sapl.compilacao.forms import (DispositivoDefinidorVigenciaForm,
DispositivoDefinidorVigenciaForm,
DispositivoEdicaoAlteracaoForm, DispositivoEdicaoAlteracaoForm,
DispositivoEdicaoBasicaForm, DispositivoEdicaoBasicaForm,
DispositivoEdicaoVigenciaForm, DispositivoEdicaoVigenciaForm,
DispositivoRegistroAlteracaoForm,
DispositivoSearchModalForm, NotaForm, DispositivoSearchModalForm, NotaForm,
PublicacaoForm, TaForm, TextNotificacoesForm, PublicacaoForm, TaForm,
TipoTaForm, VideForm, DispositivoRegistroAlteracaoForm) TextNotificacoesForm, TipoTaForm, VideForm)
from sapl.compilacao.models import ( from sapl.compilacao.models import (Dispositivo, Nota,
Dispositivo, Nota, PerfilEstruturalTextoArticulado,
PerfilEstruturalTextoArticulado, Publicacao, Publicacao, TextoArticulado,
TextoArticulado, TipoDispositivo, TipoNota, TipoDispositivo, TipoNota, TipoPublicacao,
TipoPublicacao, TipoTextoArticulado, TipoVide, TipoTextoArticulado, TipoVide,
VeiculoPublicacao, Vide) VeiculoPublicacao, Vide)
from sapl.compilacao.utils import DISPOSITIVO_SELECT_RELATED,\ from sapl.compilacao.utils import (DISPOSITIVO_SELECT_RELATED,
DISPOSITIVO_SELECT_RELATED_EDIT DISPOSITIVO_SELECT_RELATED_EDIT)
from sapl.crud.base import Crud, CrudListView, make_pagination from sapl.crud.base import Crud, CrudListView, make_pagination
TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota') TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota')
TipoVideCrud = Crud.build(TipoVide, 'tipo_vide') TipoVideCrud = Crud.build(TipoVide, 'tipo_vide')
TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao') TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao')
VeiculoPublicacaoCrud = Crud.build(VeiculoPublicacao, 'veiculo_publicacao') VeiculoPublicacaoCrud = Crud.build(VeiculoPublicacao, 'veiculo_publicacao')
#^class(.)+\((.)*^(CompMix)(.)*
class IntegracaoTaView(TemplateView): class IntegracaoTaView(TemplateView):
@ -1134,7 +1132,7 @@ class ActionDragAndMoveDispositivoAlteradoMixin(ActionsCommonsMixin):
dpt.save() dpt.save()
bloco.ordenar_bloco_alteracao() bloco.ordenar_bloco_alteracao()
data = {} return {}
class ActionDeleteDispositivoMixin(ActionsCommonsMixin): class ActionDeleteDispositivoMixin(ActionsCommonsMixin):
@ -1158,11 +1156,6 @@ class ActionDeleteDispositivoMixin(ActionsCommonsMixin):
base_anterior = base.get_nivel_zero_anterior() base_anterior = base.get_nivel_zero_anterior()
data = self.get_json_for_refresh(base_anterior) data = self.get_json_for_refresh(base_anterior)
bases_atualizacao = Dispositivo.objects.order_by('ordem').filter(
ta_id=base.ta_id,
ordem__gt=base.ordem,
nivel__lt=base.nivel)
data['pai'] = [base.get_raiz().pk] data['pai'] = [base.get_raiz().pk]
if ta_base.id != int(self.kwargs['ta_id']): if ta_base.id != int(self.kwargs['ta_id']):
@ -1727,7 +1720,8 @@ class ActionDispositivoCreateMixin(ActionsCommonsMixin):
data = {'pk': dvt.pk, data = {'pk': dvt.pk,
'pai': [dvt.pk, ]} 'pai': [dvt.pk, ]}
self.set_message(data, 'success', _('Dispositivo de Vigência atualizado ' self.set_message(data, 'success',
_('Dispositivo de Vigência atualizado '
'com sucesso!!!')) 'com sucesso!!!'))
return data return data
@ -2196,8 +2190,6 @@ class DispositivoDinamicEditView(
def get_initial(self): def get_initial(self):
initial = UpdateView.get_initial(self) initial = UpdateView.get_initial(self)
#perfil_pk = self.set_perfil_in_session(self.request)
if 'action' in self.request.GET: if 'action' in self.request.GET:
initial.update({'editor_type': self.request.GET['action']}) initial.update({'editor_type': self.request.GET['action']})
@ -2854,7 +2846,7 @@ class DispositivoEdicaoAlteracaoView(CompMixin, FormMessagesMixin, UpdateView):
try: try:
with transaction.atomic(): with transaction.atomic():
return self.form_valid(form) return self.form_valid(form)
except Exception as e: except:
return self.form_invalid(form) return self.form_invalid(form)
else: else:
return self.form_invalid(form) return self.form_invalid(form)

1
sapl/materia/admin.py

@ -1,4 +1,5 @@
from django.contrib import admin from django.contrib import admin
from sapl.materia.models import Proposicao from sapl.materia.models import Proposicao
from sapl.settings import DEBUG from sapl.settings import DEBUG
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin

1
sapl/materia/views.py

@ -1351,7 +1351,6 @@ class PrimeiraTramitacaoEmLoteView(PermissionRequiredMixin, FilterView):
else: else:
data_fim_prazo = None data_fim_prazo = None
import ipdb; ipdb.set_trace()
for materia_id in marcadas: for materia_id in marcadas:
Tramitacao.objects.create( Tramitacao.objects.create(
materia_id=materia_id, materia_id=materia_id,

3
sapl/protocoloadm/views.py

@ -14,9 +14,8 @@ from django.views.generic import CreateView, DetailView, FormView, ListView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django_filters.views import FilterView from django_filters.views import FilterView
from sapl.base.models import AppConfig
import sapl.crud.base import sapl.crud.base
from sapl.base.models import AppConfig
from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView,
CrudDeleteView, CrudListView, CrudUpdateView, CrudDeleteView, CrudListView, CrudUpdateView,
make_pagination) make_pagination)

Loading…
Cancel
Save