Browse Source

Define namespace em urls.py via app_name

pull/271/head
Marcio Mazza 9 years ago
parent
commit
86793f1ad9
  1. 2
      base/__init__.py
  2. 4
      base/apps.py
  3. 3
      base/urls.py
  4. 2
      comissoes/__init__.py
  5. 4
      comissoes/apps.py
  6. 6
      comissoes/urls.py
  7. 4
      compilacao/apps.py
  8. 4
      compilacao/urls.py
  9. 2
      crud/tests/stub_app/urls.py
  10. 11
      crud/tests/test_base.py
  11. 5
      crud/urls.py
  12. 2
      lexml/__init__.py
  13. 4
      lexml/apps.py
  14. 4
      lexml/urls.py
  15. 2
      materia/__init__.py
  16. 4
      materia/apps.py
  17. 4
      materia/urls.py
  18. 2
      norma/__init__.py
  19. 4
      norma/apps.py
  20. 4
      norma/urls.py
  21. 1
      painel/__init__.py
  22. 7
      painel/apps.py
  23. 3
      painel/urls.py
  24. 2
      parlamentares/__init__.py
  25. 4
      parlamentares/apps.py
  26. 4
      parlamentares/urls.py
  27. 2
      protocoloadm/__init__.py
  28. 4
      protocoloadm/apps.py
  29. 4
      protocoloadm/urls.py
  30. 1
      relatorios/__init__.py
  31. 7
      relatorios/apps.py
  32. 3
      relatorios/urls.py
  33. 2
      sessao/__init__.py
  34. 4
      sessao/apps.py
  35. 4
      sessao/urls.py

2
base/__init__.py

@ -1 +1 @@
default_app_config = 'base.apps.BaseAppConfig' default_app_config = 'base.apps.AppConfig'

4
base/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class BaseAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'base' name = 'base'
verbose_name = _('Dados Básicos') verbose_name = _('Dados Básicos')

3
base/urls.py

@ -2,8 +2,11 @@ from django.conf.urls import url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from .apps import AppConfig
from .views import CasaLegislativaTableAuxView, HelpView from .views import CasaLegislativaTableAuxView, HelpView
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^sistema/', TemplateView.as_view(template_name='sistema.html')), url(r'^sistema/', TemplateView.as_view(template_name='sistema.html')),
url(r'^ajuda/(?P<topic>\w+)$', HelpView.as_view(), name='help_topic'), url(r'^ajuda/(?P<topic>\w+)$', HelpView.as_view(), name='help_topic'),

2
comissoes/__init__.py

@ -1 +1 @@
default_app_config = 'comissoes.apps.ComissoesAppConfig' default_app_config = 'comissoes.apps.AppConfig'

4
comissoes/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class ComissoesAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'comissoes' name = 'comissoes'
verbose_name = _('Comissões') verbose_name = _('Comissões')

6
comissoes/urls.py

@ -7,6 +7,10 @@ from comissoes.views import (CadastrarComissaoView, CargoCrud, ComissaoCrud,
PeriodoComposicaoCrud, ReunioesView, PeriodoComposicaoCrud, ReunioesView,
TipoComissaoCrud) TipoComissaoCrud)
from .apps import AppConfig
app_name = AppConfig.name
comissao_url_patterns = ComissaoCrud.get_urls() + [ comissao_url_patterns = ComissaoCrud.get_urls() + [
url(r'^(?P<pk>\d+)/composicao$', url(r'^(?P<pk>\d+)/composicao$',
ComposicaoView.as_view(), name='composicao'), ComposicaoView.as_view(), name='composicao'),
@ -26,6 +30,8 @@ comissao_url_patterns = ComissaoCrud.get_urls() + [
CadastrarComissaoView.as_view(), name='cadastrar_comissao'), CadastrarComissaoView.as_view(), name='cadastrar_comissao'),
] ]
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^comissoes/', include(comissao_url_patterns)), url(r'^comissoes/', include(comissao_url_patterns)),

4
compilacao/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class CompilacaoAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'compilacao' name = 'compilacao'
verbose_name = _('Compilação') verbose_name = _('Compilação')

4
compilacao/urls.py

@ -4,6 +4,10 @@ from compilacao import views
from compilacao.views import (TipoNotaCrud, TipoPublicacaoCrud, TipoVideCrud, from compilacao.views import (TipoNotaCrud, TipoPublicacaoCrud, TipoVideCrud,
VeiculoPublicacaoCrud) VeiculoPublicacaoCrud)
from .apps import AppConfig
app_name = AppConfig.name
urlpatterns_compilacao = [ urlpatterns_compilacao = [
url(r'^$', views.TaListView.as_view(), name='ta_list'), url(r'^$', views.TaListView.as_view(), name='ta_list'),
url(r'^create$', views.TaCreateView.as_view(), name='ta_create'), url(r'^create$', views.TaCreateView.as_view(), name='ta_create'),

2
crud/tests/stub_app/urls.py

@ -3,5 +3,5 @@ from django.conf.urls import include, url
from .views import CountryCrud from .views import CountryCrud
urlpatterns = [ urlpatterns = [
url(r'^countries/', include(CountryCrud.get_urls())), url(r'^countries/', include(CountryCrud.get_urls(), 'stub_app')),
] ]

11
crud/tests/test_base.py

@ -140,11 +140,12 @@ def test_layout_detail_fieldsets(monkeypatch):
def test_reverse(): def test_reverse():
assert '/countries/' == reverse('country_list') assert '/countries/' == reverse('stub_app:country_list')
assert '/countries/create' == reverse('country_create') assert '/countries/create' == reverse('stub_app:country_create')
assert '/countries/2' == reverse('country_detail', args=(2,)) assert '/countries/2' == reverse('stub_app:country_detail', args=(2,))
assert '/countries/2/edit' == reverse('country_update', args=(2,)) assert '/countries/2/edit' == reverse('stub_app:country_update', args=(2,))
assert '/countries/2/delete' == reverse('country_delete', args=(2,)) assert '/countries/2/delete' == reverse(
'stub_app:country_delete', args=(2,))
def assert_h1(res, title): def assert_h1(res, title):

5
crud/urls.py

@ -0,0 +1,5 @@
from django.conf.urls import include, url
urlpatterns = [
url(r'', include('stub_app.urls')),
]

2
lexml/__init__.py

@ -1 +1 @@
default_app_config = 'lexml.apps.LexmlAppConfig' default_app_config = 'lexml.apps.AppConfig'

4
lexml/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class LexmlAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'lexml' name = 'lexml'
verbose_name = _('LexML') verbose_name = _('LexML')

4
lexml/urls.py

@ -2,6 +2,10 @@ from django.conf.urls import include, url
from lexml.views import LexmlProvedorCrud, LexmlPublicadorCrud from lexml.views import LexmlProvedorCrud, LexmlPublicadorCrud
from .apps import AppConfig
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^sistema/lexml/provedor/', url(r'^sistema/lexml/provedor/',
include(LexmlProvedorCrud.get_urls())), include(LexmlProvedorCrud.get_urls())),

2
materia/__init__.py

@ -1 +1 @@
default_app_config = 'materia.apps.MateriaAppConfig' default_app_config = 'materia.apps.AppConfig'

4
materia/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class MateriaAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'materia' name = 'materia'
verbose_name = _('Matéria') verbose_name = _('Matéria')

4
materia/urls.py

@ -22,6 +22,10 @@ from materia.views import (AcompanhamentoConfirmarView,
TramitacaoEditView, TramitacaoView, TramitacaoEditView, TramitacaoView,
UnidadeTramitacaoCrud) UnidadeTramitacaoCrud)
from .apps import AppConfig
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^materia/', include(MateriaLegislativaCrud.get_urls())), url(r'^materia/', include(MateriaLegislativaCrud.get_urls())),

2
norma/__init__.py

@ -1 +1 @@
default_app_config = 'norma.apps.NormaAppConfig' default_app_config = 'norma.apps.AppConfig'

4
norma/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class NormaAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'norma' name = 'norma'
verbose_name = _('Norma Jurídica') verbose_name = _('Norma Jurídica')

4
norma/urls.py

@ -4,6 +4,10 @@ from norma.views import (AssuntoNormaCrud, NormaEditView, NormaIncluirView,
NormaPesquisaView, NormaTaView, NormaTemporarioCrud, NormaPesquisaView, NormaTaView, NormaTemporarioCrud,
PesquisaNormaListView, TipoNormaCrud) PesquisaNormaListView, TipoNormaCrud)
from .apps import AppConfig
app_name = AppConfig.name
# @LeandroRoberto comentou em # @LeandroRoberto comentou em
# https://github.com/interlegis/sapl/pull/255#discussion_r55894269 # https://github.com/interlegis/sapl/pull/255#discussion_r55894269
# #

1
painel/__init__.py

@ -0,0 +1 @@
default_app_config = 'painel.apps.AppConfig'

7
painel/apps.py

@ -0,0 +1,7 @@
from django import apps
from django.utils.translation import ugettext_lazy as _
class AppConfig(apps.AppConfig):
name = 'painel'
verbose_name = _('Painel Eletrônico')

3
painel/urls.py

@ -1,10 +1,13 @@
from django.conf.urls import url from django.conf.urls import url
from .apps import AppConfig
from .views import controlador_painel # CronometroPainelCrud, from .views import controlador_painel # CronometroPainelCrud,
from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view, from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view,
painel_parlamentares_view, painel_view, painel_parlamentares_view, painel_view,
painel_votacao_view) painel_votacao_view)
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^(?P<pk>\d+)/painel$', painel_view, name="painel_principal"), url(r'^(?P<pk>\d+)/painel$', painel_view, name="painel_principal"),
url(r'^painel/(?P<pk>\d+)/dados$', get_dados_painel, name='dados_painel'), url(r'^painel/(?P<pk>\d+)/dados$', get_dados_painel, name='dados_painel'),

2
parlamentares/__init__.py

@ -1 +1 @@
default_app_config = 'parlamentares.apps.ParlamentaresAppConfig' default_app_config = 'parlamentares.apps.AppConfig'

4
parlamentares/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class ParlamentaresAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'parlamentares' name = 'parlamentares'
verbose_name = _('Parlamentares') verbose_name = _('Parlamentares')

4
parlamentares/urls.py

@ -12,6 +12,10 @@ from parlamentares.views import (CargoMesaCrud, ColigacaoCrud,
TipoAfastamentoCrud, TipoDependenteCrud, TipoAfastamentoCrud, TipoDependenteCrud,
TipoMilitarCrud) TipoMilitarCrud)
from .apps import AppConfig
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^sistema/parlamentares/legislatura/', url(r'^sistema/parlamentares/legislatura/',
include(LegislaturaCrud.get_urls())), include(LegislaturaCrud.get_urls())),

2
protocoloadm/__init__.py

@ -1 +1 @@
default_app_config = 'protocoloadm.apps.ProtocoloadmAppConfig' default_app_config = 'protocoloadm.apps.AppConfig'

4
protocoloadm/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class ProtocoloadmAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'protocoloadm' name = 'protocoloadm'
verbose_name = _('Protocolo Administrativo') verbose_name = _('Protocolo Administrativo')

4
protocoloadm/urls.py

@ -24,6 +24,10 @@ from protocoloadm.views import (AnularProtocoloAdmView,
TramitacaoAdministrativoCrud, TramitacaoAdministrativoCrud,
TramitacaoAdmView, pesquisa_autores) TramitacaoAdmView, pesquisa_autores)
from .apps import AppConfig
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^protocoloadm/docadm/', url(r'^protocoloadm/docadm/',
include(DocumentoAdministrativoCrud.get_urls())), include(DocumentoAdministrativoCrud.get_urls())),

1
relatorios/__init__.py

@ -0,0 +1 @@
default_app_config = 'relatorios.apps.AppConfig'

7
relatorios/apps.py

@ -0,0 +1,7 @@
from django import apps
from django.utils.translation import ugettext_lazy as _
class AppConfig(apps.AppConfig):
name = 'relatorios'
verbose_name = _('Relatórios')

3
relatorios/urls.py

@ -1,11 +1,14 @@
from django.conf.urls import url from django.conf.urls import url
from .apps import AppConfig
from .views import (relatorio_capa_processo, from .views import (relatorio_capa_processo,
relatorio_documento_administrativo, relatorio_espelho, relatorio_documento_administrativo, relatorio_espelho,
relatorio_etiqueta_protocolo, relatorio_materia, relatorio_etiqueta_protocolo, relatorio_materia,
relatorio_ordem_dia, relatorio_pauta_sessao, relatorio_ordem_dia, relatorio_pauta_sessao,
relatorio_protocolo, relatorio_sessao_plenaria) relatorio_protocolo, relatorio_sessao_plenaria)
app_name = AppConfig.name
urlpatterns = [ urlpatterns = [
url(r'^relatorios/materia$', relatorio_materia, name='relatorio_materia'), url(r'^relatorios/materia$', relatorio_materia, name='relatorio_materia'),
url(r'^relatorios/capa_processo$', url(r'^relatorios/capa_processo$',

2
sessao/__init__.py

@ -1 +1 @@
default_app_config = 'sessao.apps.SessaoAppConfig' default_app_config = 'sessao.apps.AppConfig'

4
sessao/apps.py

@ -1,7 +1,7 @@
from django.apps import AppConfig from django import apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class SessaoAppConfig(AppConfig): class AppConfig(apps.AppConfig):
name = 'sessao' name = 'sessao'
verbose_name = _('Sessão Plenária') verbose_name = _('Sessão Plenária')

4
sessao/urls.py

@ -21,6 +21,10 @@ from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView,
VotacaoNominalExpedienteView, VotacaoNominalView, VotacaoNominalExpedienteView, VotacaoNominalView,
VotacaoView) VotacaoView)
from .apps import AppConfig
app_name = AppConfig.name
urlpatterns_sessao = SessaoCrud.get_urls() + [ urlpatterns_sessao = SessaoCrud.get_urls() + [
url(r'^(?P<pk>\d+)/expediente$', url(r'^(?P<pk>\d+)/expediente$',
ExpedienteView.as_view(), name='expediente'), ExpedienteView.as_view(), name='expediente'),

Loading…
Cancel
Save