Browse Source

Sort all imports using isort

isort -rc .
pull/6/head
Marcio Mazza 10 years ago
parent
commit
6817248bad
  1. 1
      base/admin.py
  2. 2
      base/migrations/0001_initial.py
  3. 1
      comissoes/admin.py
  4. 2
      comissoes/migrations/0001_initial.py
  5. 5
      comissoes/urls.py
  6. 2
      comissoes/views.py
  7. 1
      conftest.py
  8. 1
      legacy/migration.py
  9. 2
      legacy/migrations/0001_initial.py
  10. 6
      legacy/scripts/scrap_original_forms.py
  11. 1
      legacy/scripts/study.py
  12. 2
      legacy/test_renames.py
  13. 1
      lexml/admin.py
  14. 2
      lexml/migrations/0001_initial.py
  15. 3
      lexml/views.py
  16. 1
      materia/admin.py
  17. 2
      materia/migrations/0001_initial.py
  18. 11
      materia/views.py
  19. 1
      norma/admin.py
  20. 2
      norma/migrations/0001_initial.py
  21. 5
      norma/views.py
  22. 1
      parlamentares/admin.py
  23. 2
      parlamentares/migrations/0001_initial.py
  24. 11
      parlamentares/views.py
  25. 1
      protocoloadm/admin.py
  26. 2
      protocoloadm/migrations/0001_initial.py
  27. 6
      protocoloadm/views.py
  28. 7
      sapl/crud.py
  29. 4
      sapl/layout.py
  30. 1
      sapl/settings.py
  31. 4
      sapl/test_crud.py
  32. 1
      sapl/test_general.py
  33. 1
      sapl/test_utils.py
  34. 2
      sapl/teststubs/urls_for_list_test.py
  35. 32
      sapl/urls.py
  36. 1
      sapl/utils.py
  37. 1
      sessao/admin.py
  38. 2
      sessao/migrations/0001_initial.py
  39. 4
      sessao/models.py
  40. 5
      sessao/urls.py
  41. 13
      sessao/views.py

1
base/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
base/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

1
comissoes/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
comissoes/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

5
comissoes/urls.py

@ -1,8 +1,7 @@
from django.conf.urls import url from django.conf.urls import url
from comissoes.views import ( from comissoes.views import (ComposicaoView, MateriasView, ReunioesView,
comissao_crud, ComposicaoView, MateriasView, ReunioesView) comissao_crud)
urlpatterns = comissao_crud.urlpatterns + [ urlpatterns = comissao_crud.urlpatterns + [
url(r'^(?P<pk>\d+)/composicao$', url(r'^(?P<pk>\d+)/composicao$',

2
comissoes/views.py

@ -1,8 +1,8 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from .models import (TipoComissao, Comissao, Periodo, CargoComissao)
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import CargoComissao, Comissao, Periodo, TipoComissao
cargo_crud = build_crud( cargo_crud = build_crud(
CargoComissao, CargoComissao,

1
conftest.py

@ -1,7 +1,6 @@
import pytest import pytest
from django_webtest import DjangoTestApp, WebTestMixin from django_webtest import DjangoTestApp, WebTestMixin
DEFAULT_MARK = object() DEFAULT_MARK = object()

1
legacy/migration.py

@ -13,7 +13,6 @@ from comissoes.models import Composicao, Participacao
from parlamentares.models import Parlamentar from parlamentares.models import Parlamentar
from sapl.utils import appconfs from sapl.utils import appconfs
# BASE ###################################################################### # BASE ######################################################################
name_sets = [set(m.__name__ for m in ac.get_models()) for ac in appconfs] name_sets = [set(m.__name__ for m in ac.get_models()) for ac in appconfs]

2
legacy/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

6
legacy/scripts/scrap_original_forms.py

@ -1,5 +1,5 @@
import pprint
import os import os
import pprint
import re import re
import string import string
@ -7,12 +7,10 @@ import pkg_resources
import yaml import yaml
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from bs4.element import NavigableString, Tag from bs4.element import NavigableString, Tag
from django.apps.config import AppConfig from django.apps.config import AppConfig
from legacy.migration import appconfs, get_renames from legacy.migration import appconfs, get_renames
from legacy.scripts.utils import listify, getsourcelines from legacy.scripts.utils import getsourcelines, listify
# to prevent removal by automatic organize imports on this file # to prevent removal by automatic organize imports on this file
assert appconfs assert appconfs

1
legacy/scripts/study.py

@ -2,7 +2,6 @@ from django.apps import apps
from .migration_base import legacy_app from .migration_base import legacy_app
for model in apps.get_app_config('legacy').get_models(): for model in apps.get_app_config('legacy').get_models():
if 'ind_excluido' in [f.name for f in model._meta.fields]: if 'ind_excluido' in [f.name for f in model._meta.fields]:
print(model, model.objects.values_list( print(model, model.objects.values_list(

2
legacy/test_renames.py

@ -1,7 +1,7 @@
import comissoes import comissoes
import materia import materia
from .migration import appconfs, get_renames, legacy_app
from .migration import appconfs, get_renames, legacy_app
RENAMING_IGNORED_MODELS = [ RENAMING_IGNORED_MODELS = [
comissoes.models.Composicao, comissoes.models.Composicao,

1
lexml/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
lexml/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

3
lexml/views.py

@ -1,7 +1,8 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (LexmlProvedor, LexmlPublicador)
from .models import LexmlProvedor, LexmlPublicador
lexml_provedor_crud = build_crud( lexml_provedor_crud = build_crud(
LexmlProvedor, LexmlProvedor,

1
materia/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
materia/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

11
materia/views.py

@ -1,11 +1,12 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (Origem, TipoMateriaLegislativa, RegimeTramitacao,
TipoDocumento, TipoFimRelatoria, MateriaLegislativa, from .models import (Anexada, Autor, Autoria, DocumentoAcessorio,
Anexada, TipoAutor, Autor, Autoria, DocumentoAcessorio, MateriaLegislativa, Numeracao, Orgao, Origem, Proposicao,
Numeracao, Orgao, Relatoria, TipoProposicao, Proposicao, RegimeTramitacao, Relatoria, StatusTramitacao, TipoAutor,
StatusTramitacao, UnidadeTramitacao, Tramitacao) TipoDocumento, TipoFimRelatoria, TipoMateriaLegislativa,
TipoProposicao, Tramitacao, UnidadeTramitacao)
origem_crud = build_crud( origem_crud = build_crud(
Origem, Origem,

1
norma/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
norma/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

5
norma/views.py

@ -1,8 +1,9 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (AssuntoNorma, TipoNormaJuridica,
NormaJuridica, LegislacaoCitada) from .models import (AssuntoNorma, LegislacaoCitada, NormaJuridica,
TipoNormaJuridica)
assunto_norma_crud = build_crud( assunto_norma_crud = build_crud(
AssuntoNorma, AssuntoNorma,

1
parlamentares/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
parlamentares/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

11
parlamentares/views.py

@ -1,12 +1,11 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (Legislatura, Coligacao, Partido,
Dependente, SessaoLegislativa, from .models import (CargoMesa, Coligacao, Dependente, Filiacao, Legislatura,
Parlamentar, Filiacao, Mandato, Mandato, NivelInstrucao, Parlamentar, Partido,
TipoDependente, NivelInstrucao, SessaoLegislativa, SituacaoMilitar, TipoAfastamento,
TipoAfastamento, SituacaoMilitar, TipoDependente)
CargoMesa)
cargo_mesa_crud = build_crud( cargo_mesa_crud = build_crud(
CargoMesa, CargoMesa,

1
protocoloadm/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
protocoloadm/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

6
protocoloadm/views.py

@ -1,10 +1,10 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (TipoDocumentoAdministrativo, DocumentoAdministrativo,
from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
Protocolo, StatusTramitacaoAdministrativo, Protocolo, StatusTramitacaoAdministrativo,
TramitacaoAdministrativo, TipoDocumentoAdministrativo, TramitacaoAdministrativo)
DocumentoAcessorioAdministrativo)
tipo_documento_administrativo_crud = build_crud( tipo_documento_administrativo_crud = build_crud(
TipoDocumentoAdministrativo, TipoDocumentoAdministrativo,

7
sapl/crud.py

@ -3,13 +3,12 @@ from crispy_forms.helper import FormHelper
from django import forms from django import forms
from django.conf.urls import url from django.conf.urls import url
from django.core.urlresolvers import reverse, reverse_lazy from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic import ( from django.views.generic import (CreateView, DeleteView, DetailView, ListView,
CreateView, DeleteView, ListView, UpdateView, DetailView) UpdateView)
from sapl.layout import SaplFormLayout from sapl.layout import SaplFormLayout
from django.utils.functional import cached_property
NO_ENTRIES_MSG = _('Não existem registros') NO_ENTRIES_MSG = _('Não existem registros')

4
sapl/layout.py

@ -1,5 +1,5 @@
from crispy_forms_foundation.layout import ( from crispy_forms_foundation.layout import (HTML, Column, Div, Fieldset,
Div, Layout, Fieldset, Row, Column, Submit, HTML) Layout, Row, Submit)
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _

1
sapl/settings.py

@ -13,7 +13,6 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

4
sapl/test_crud.py

@ -2,10 +2,10 @@ import pytest
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from model_mommy import mommy from model_mommy import mommy
from .crud import (get_field_display, build_crud, make_pagination, from_to,
NO_ENTRIES_MSG)
from comissoes.models import Comissao, TipoComissao from comissoes.models import Comissao, TipoComissao
from .crud import (NO_ENTRIES_MSG, build_crud, from_to, get_field_display,
make_pagination)
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db

1
sapl/test_general.py

@ -3,7 +3,6 @@ from model_mommy import mommy
from .utils import appconfs from .utils import appconfs
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db

1
sapl/test_utils.py

@ -1,4 +1,5 @@
from pytest import mark from pytest import mark
from .utils import make_choices from .utils import make_choices

2
sapl/teststubs/urls_for_list_test.py

@ -1,8 +1,8 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from sapl.crud import build_crud
from comissoes.models import Comissao from comissoes.models import Comissao
from comissoes.urls import comissoes_urls from comissoes.urls import comissoes_urls
from sapl.crud import build_crud
crud = build_crud( crud = build_crud(
Comissao, Comissao,

32
sapl/urls.py

@ -17,23 +17,23 @@ from django.conf.urls import include, url
from django.contrib import admin from django.contrib import admin
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from comissoes.views import (
tipo_comissao_crud, periodo_composicao_crud, cargo_crud)
from parlamentares.views import (legislatura_crud, coligacao_crud,
partido_crud, tipo_dependente_crud,
nivel_instrucao_crud, tipo_afastamento_crud,
tipo_militar_crud, sessao_legislativa_crud,
cargo_mesa_crud)
from materia.views import (tipo_materia_crud, regime_tramitacao_crud,
tipo_autor_crud, tipo_documento_crud,
tipo_fim_relatoria_crud, unidade_tramitacao_crud,
origem_crud, autor_crud, status_tramitacao_crud,
orgao_crud, tipo_proposicao_crud)
from lexml.views import (lexml_provedor_crud, lexml_publicador_crud)
from norma.views import (tipo_norma_crud, assunto_norma_crud)
from sessao.views import (tipo_sessao_crud, tipo_resultado_votacao_crud,
tipo_expediente_crud)
from comissoes.urls import comissoes_urls from comissoes.urls import comissoes_urls
from comissoes.views import (cargo_crud, periodo_composicao_crud,
tipo_comissao_crud)
from lexml.views import lexml_provedor_crud, lexml_publicador_crud
from materia.views import (autor_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)
from norma.views import assunto_norma_crud, tipo_norma_crud
from parlamentares.views import (cargo_mesa_crud, coligacao_crud,
legislatura_crud, nivel_instrucao_crud,
partido_crud, sessao_legislativa_crud,
tipo_afastamento_crud, tipo_dependente_crud,
tipo_militar_crud)
from sessao.views import (tipo_expediente_crud, tipo_resultado_votacao_crud,
tipo_sessao_crud)
urlpatterns = [ urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='index.html')), url(r'^$', TemplateView.as_view(template_name='index.html')),

1
sapl/utils.py

@ -1,7 +1,6 @@
from django.apps import apps from django.apps import apps
from django.contrib import admin from django.contrib import admin
# SAPL business apps # SAPL business apps
# This is a dependency order: each entry depends only on previous ones # This is a dependency order: each entry depends only on previous ones
# The order is important for migration code # The order is important for migration code

1
sessao/admin.py

@ -1,4 +1,3 @@
from sapl.utils import register_all_models_in_admin from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__) register_all_models_in_admin(__name__)

2
sessao/migrations/0001_initial.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):

4
sessao/models.py

@ -2,8 +2,8 @@ from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from materia.models import MateriaLegislativa from materia.models import MateriaLegislativa
from parlamentares.models import (CargoMesa, Parlamentar, SessaoLegislativa, from parlamentares.models import (CargoMesa, Legislatura, Parlamentar,
Legislatura) SessaoLegislativa)
from sapl.utils import make_choices from sapl.utils import make_choices

5
sessao/urls.py

@ -1,8 +1,7 @@
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from sessao.views import (SessaoPlenariaListView, SessaoPlenariaDetailView, from sessao.views import (SessaoPlenariaCreateView, SessaoPlenariaDetailView,
SessaoPlenariaCreateView, SessaoPlenariaUpdateView) SessaoPlenariaListView, SessaoPlenariaUpdateView)
urlpatterns = patterns( urlpatterns = patterns(
'sessao.views', 'sessao.views',

13
sessao/views.py

@ -1,15 +1,14 @@
from django.utils.translation import ugettext_lazy as _
from braces.views import FormMessagesMixin from braces.views import FormMessagesMixin
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy
from django.views.generic import ( from django.utils.translation import ugettext_lazy as _
CreateView, DeleteView, ListView, UpdateView, DetailView) from django.views.generic import (CreateView, DeleteView, DetailView, ListView,
UpdateView)
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (TipoSessaoPlenaria, SessaoPlenaria,
ExpedienteMateria, OrdemDia, TipoResultadoVotacao,
RegistroVotacao, TipoExpediente)
from .models import (ExpedienteMateria, OrdemDia, RegistroVotacao,
SessaoPlenaria, TipoExpediente, TipoResultadoVotacao,
TipoSessaoPlenaria)
tipo_sessao_crud = build_crud( tipo_sessao_crud = build_crud(
TipoSessaoPlenaria, TipoSessaoPlenaria,

Loading…
Cancel
Save