Browse Source

HOT-FIX: conserta ordem importação e prefixo 'base' em app base

pull/714/head
Edward Ribeiro 8 years ago
parent
commit
ffac50bdcc
  1. 2
      sapl/base/forms.py
  2. 3
      sapl/base/models.py
  3. 3
      sapl/base/templatetags/menus.py
  4. 16
      sapl/base/urls.py
  5. 6
      sapl/compilacao/urls.py
  6. 10
      sapl/compilacao/views.py
  7. 3
      sapl/crud/base.py
  8. 1
      sapl/materia/forms.py
  9. 3
      sapl/materia/views.py
  10. 1
      sapl/norma/views.py
  11. 3
      sapl/protocoloadm/views.py
  12. 2
      sapl/relatorios/views.py
  13. 1
      sapl/sessao/views.py
  14. 3
      sapl/test_general.py
  15. 7
      sapl/test_urls.py

2
sapl/base/forms.py

@ -1,3 +1,4 @@
import django_filters
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Fieldset, Layout from crispy_forms.layout import HTML, Button, Fieldset, Layout
from django import forms from django import forms
@ -6,7 +7,6 @@ from django.core.exceptions import ValidationError
from django.db import models from django.db import models
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import django_filters
from sapl.crispy_layout_mixin import form_actions, to_row from sapl.crispy_layout_mixin import form_actions, to_row
from sapl.materia.models import MateriaLegislativa from sapl.materia.models import MateriaLegislativa

3
sapl/base/models.py

@ -7,12 +7,11 @@ from django.contrib.contenttypes.models import ContentType
from django.core import exceptions from django.core import exceptions
from django.db import models, router from django.db import models, router
from django.db.utils import DEFAULT_DB_ALIAS from django.db.utils import DEFAULT_DB_ALIAS
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
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')))

3
sapl/base/templatetags/menus.py

@ -1,7 +1,6 @@
import yaml
from django import template from django import template
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
import yaml
register = template.Library() register = template.Library()

16
sapl/base/urls.py

@ -25,30 +25,30 @@ urlpatterns = [
url(r'^ajuda/(?P<topic>\w+)$', HelpView.as_view(), name='help_topic'), url(r'^ajuda/(?P<topic>\w+)$', HelpView.as_view(), name='help_topic'),
url(r'^ajuda/', TemplateView.as_view(template_name='ajuda/index.html'), url(r'^ajuda/', TemplateView.as_view(template_name='ajuda/index.html'),
name='help_base'), name='help_base'),
url(r'^casa-legislativa/', include(CasaLegislativaCrud.get_urls()), url(r'^sistema/casa-legislativa/', include(CasaLegislativaCrud.get_urls()),
name="casa_legislativa"), name="casa_legislativa"),
url(r'^app-config/', include(AppConfigCrud.get_urls())), url(r'^sistema/app-config/', include(AppConfigCrud.get_urls())),
url(r'^login/$', views.login, { url(r'^login/$', views.login, {
'template_name': 'base/login.html', 'authentication_form': LoginForm}, 'template_name': 'base/login.html', 'authentication_form': LoginForm},
name='login'), name='login'),
url(r'^logout/$', views.logout, {'next_page': '/login'}, name='logout'), url(r'^logout/$', views.logout, {'next_page': '/login'}, name='logout'),
url(r'^relatorios/materia-por-autor$', url(r'^sistema/relatorios/materia-por-autor$',
RelatorioMateriasPorAutorView.as_view(), name='materia_por_autor'), RelatorioMateriasPorAutorView.as_view(), name='materia_por_autor'),
url(r'^relatorios/materia-por-ano-autor-tipo$', url(r'^sistema/relatorios/materia-por-ano-autor-tipo$',
RelatorioMateriasPorAnoAutorTipoView.as_view(), RelatorioMateriasPorAnoAutorTipoView.as_view(),
name='materia_por_ano_autor_tipo'), name='materia_por_ano_autor_tipo'),
url(r'^relatorios/materia-por-tramitacao$', url(r'^sistema/relatorios/materia-por-tramitacao$',
RelatorioMateriasTramitacaoView.as_view(), RelatorioMateriasTramitacaoView.as_view(),
name='materia_por_tramitacao'), name='materia_por_tramitacao'),
url(r'^relatorios/historico-tramitacoes$', url(r'^sistema/relatorios/historico-tramitacoes$',
RelatorioHistoricoTramitacaoView.as_view(), RelatorioHistoricoTramitacaoView.as_view(),
name='historico_tramitacoes'), name='historico_tramitacoes'),
url(r'^relatorios/presenca$', url(r'^sistema/relatorios/presenca$',
RelatorioPresencaSessaoView.as_view(), RelatorioPresencaSessaoView.as_view(),
name='presenca_sessao'), name='presenca_sessao'),
url(r'^relatorios/atas$', url(r'^sistema/relatorios/atas$',
RelatorioAtasView.as_view(), RelatorioAtasView.as_view(),
name='atas'), name='atas'),

6
sapl/compilacao/urls.py

@ -1,9 +1,9 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from sapl.compilacao import views from sapl.compilacao import views
from sapl.compilacao.views import (TipoNotaCrud, TipoPublicacaoCrud, from sapl.compilacao.views import (TipoDispositivoCrud, TipoNotaCrud,
TipoVideCrud, VeiculoPublicacaoCrud, TipoPublicacaoCrud, TipoVideCrud,
TipoDispositivoCrud) VeiculoPublicacaoCrud)
from .apps import AppConfig from .apps import AppConfig

10
sapl/compilacao/views.py

@ -1,7 +1,7 @@
from collections import OrderedDict
from datetime import datetime, timedelta
import logging import logging
import sys import sys
from collections import OrderedDict
from datetime import datetime, timedelta
from braces.views import FormMessagesMixin from braces.views import FormMessagesMixin
from django import forms from django import forms
@ -11,7 +11,7 @@ from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.signing import Signer from django.core.signing import Signer
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy
from django.db import transaction, connection from django.db import connection, transaction
from django.db.models import Q from django.db.models import Q
from django.db.utils import IntegrityError from django.db.utils import IntegrityError
from django.http.response import (HttpResponse, HttpResponseRedirect, from django.http.response import (HttpResponse, HttpResponseRedirect,
@ -20,7 +20,8 @@ from django.shortcuts import get_object_or_404, redirect
from django.utils.dateparse import parse_date from django.utils.dateparse import parse_date
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _, string_concat from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView from django.views.generic.detail import DetailView
from django.views.generic.edit import (CreateView, DeleteView, FormView, from django.views.generic.edit import (CreateView, DeleteView, FormView,
@ -47,7 +48,6 @@ 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')

3
sapl/crud/base.py

@ -13,8 +13,8 @@ from django.db import models
from django.http.response import Http404 from django.http.response import Http404
from django.utils.decorators import classonlymethod from django.utils.decorators import classonlymethod
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from django.views.generic import (CreateView, DeleteView, DetailView, ListView, from django.views.generic import (CreateView, DeleteView, DetailView, ListView,
UpdateView) UpdateView)
from django.views.generic.base import ContextMixin from django.views.generic.base import ContextMixin
@ -23,7 +23,6 @@ from django.views.generic.list import MultipleObjectMixin
from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display
from sapl.utils import normalize from sapl.utils import normalize
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \ ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \

1
sapl/materia/forms.py

@ -27,6 +27,7 @@ from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria,
Numeracao, Proposicao, Relatoria, TipoMateriaLegislativa, Numeracao, Proposicao, Relatoria, TipoMateriaLegislativa,
Tramitacao, UnidadeTramitacao) Tramitacao, UnidadeTramitacao)
def ANO_CHOICES(): def ANO_CHOICES():
return [('', '---------')] + RANGE_ANOS return [('', '---------')] + RANGE_ANOS

3
sapl/materia/views.py

@ -24,7 +24,7 @@ from django.views.generic import CreateView, ListView, TemplateView, UpdateView
from django.views.generic.base import RedirectView from django.views.generic.base import RedirectView
from django_filters.views import FilterView from django_filters.views import FilterView
from sapl.base.models import CasaLegislativa, AppConfig from sapl.base.models import AppConfig, CasaLegislativa
from sapl.compilacao.views import IntegracaoTaView from sapl.compilacao.views import IntegracaoTaView
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row
from sapl.crud.base import (ACTION_CREATE, ACTION_DELETE, ACTION_DETAIL, from sapl.crud.base import (ACTION_CREATE, ACTION_DELETE, ACTION_DETAIL,
@ -53,7 +53,6 @@ from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria,
TipoFimRelatoria, TipoMateriaLegislativa, TipoProposicao, TipoFimRelatoria, TipoMateriaLegislativa, TipoProposicao,
Tramitacao, UnidadeTramitacao) Tramitacao, UnidadeTramitacao)
OrigemCrud = Crud.build(Origem, '') OrigemCrud = Crud.build(Origem, '')
TipoMateriaCrud = CrudAux.build( TipoMateriaCrud = CrudAux.build(

1
sapl/norma/views.py

@ -13,7 +13,6 @@ from sapl.norma.forms import NormaJuridicaForm
from .forms import NormaJuridicaPesquisaForm from .forms import NormaJuridicaPesquisaForm
from .models import AssuntoNorma, NormaJuridica, TipoNormaJuridica from .models import AssuntoNorma, NormaJuridica, TipoNormaJuridica
# LegislacaoCitadaCrud = Crud.build(LegislacaoCitada, '') # LegislacaoCitadaCrud = Crud.build(LegislacaoCitada, '')
AssuntoNormaCrud = CrudAux.build(AssuntoNorma, 'assunto_norma_juridica', AssuntoNormaCrud = CrudAux.build(AssuntoNorma, 'assunto_norma_juridica',
list_field_names=['assunto', 'descricao']) list_field_names=['assunto', 'descricao'])

3
sapl/protocoloadm/views.py

@ -29,8 +29,7 @@ from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
from .models import (Autor, DocumentoAcessorioAdministrativo, from .models import (Autor, DocumentoAcessorioAdministrativo,
DocumentoAdministrativo, Protocolo, DocumentoAdministrativo, Protocolo,
StatusTramitacaoAdministrativo, StatusTramitacaoAdministrativo,
TipoDocumentoAdministrativo, TipoDocumentoAdministrativo, TramitacaoAdministrativo)
TramitacaoAdministrativo)
TipoDocumentoAdministrativoCrud = CrudAux.build( TipoDocumentoAdministrativoCrud = CrudAux.build(
TipoDocumentoAdministrativo, '') TipoDocumentoAdministrativo, '')

2
sapl/relatorios/views.py

@ -1,7 +1,7 @@
from datetime import datetime from datetime import datetime
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from django.http import HttpResponse, Http404 from django.http import Http404, HttpResponse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.base.models import CasaLegislativa from sapl.base.models import CasaLegislativa

1
sapl/sessao/views.py

@ -46,7 +46,6 @@ from .models import (Bancada, Bloco, CargoBancada, CargoMesa,
SessaoPlenariaPresenca, TipoExpediente, SessaoPlenariaPresenca, TipoExpediente,
TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar) TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar)
TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria') TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria')
TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente') TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente')
CargoBancadaCrud = CrudAux.build(CargoBancada, '') CargoBancadaCrud = CrudAux.build(CargoBancada, '')

3
sapl/test_general.py

@ -1,7 +1,8 @@
import pytest
from django.apps import apps from django.apps import apps
from django.db.models import CharField, TextField from django.db.models import CharField, TextField
from model_mommy import mommy from model_mommy import mommy
import pytest
from .settings import SAPL_APPS from .settings import SAPL_APPS
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db

7
sapl/test_urls.py

@ -1,3 +1,4 @@
import pytest
from django.apps import apps from django.apps import apps
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.auth.management import _get_all_permissions from django.contrib.auth.management import _get_all_permissions
@ -7,18 +8,16 @@ from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db.models import CharField, TextField from django.db.models import CharField, TextField
from django.http.response import HttpResponseNotFound from django.http.response import HttpResponseNotFound
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from model_mommy import mommy from model_mommy import mommy
import pytest
from sapl.crud.base import PermissionRequiredForAppCrudMixin, CrudAux from sapl.crud.base import CrudAux, PermissionRequiredForAppCrudMixin
from scripts.inicializa_grupos_autorizacoes import cria_grupos_permissoes from scripts.inicializa_grupos_autorizacoes import cria_grupos_permissoes
from scripts.lista_urls import lista_urls from scripts.lista_urls import lista_urls
from .settings import SAPL_APPS from .settings import SAPL_APPS
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db
sapl_appconfs = [apps.get_app_config(n[5:]) for n in SAPL_APPS] sapl_appconfs = [apps.get_app_config(n[5:]) for n in SAPL_APPS]

Loading…
Cancel
Save