Browse Source

Correct lots of deprecation warnings mainly in url.py files

Signed-off-by: Luciano Almeida <lucianoalmeida@interlegis.leg.br>
pull/6/head
Luciano Almeida 8 years ago
committed by Luciano Almeida
parent
commit
3f96ccb916
  1. 4
      moodlerouter.py
  2. 38
      sigi/apps/casas/urls.py
  3. 21
      sigi/apps/convenios/urls.py
  4. 56
      sigi/apps/diagnosticos/urls.py
  5. 2
      sigi/apps/diagnosticos/views.py
  6. 12
      sigi/apps/eventos/urls.py
  7. 22
      sigi/apps/home/urls.py
  8. 2
      sigi/apps/mdl/models.py
  9. 20
      sigi/apps/metas/urls.py
  10. 28
      sigi/apps/ocorrencias/urls.py
  11. 19
      sigi/apps/parlamentares/urls.py
  12. 19
      sigi/apps/saberes/urls.py
  13. 21
      sigi/apps/servicos/migrations/0005_auto_20160912_1503.py
  14. 2
      sigi/apps/servicos/models.py
  15. 14
      sigi/apps/servicos/urls.py
  16. 22
      sigi/apps/servidores/migrations/0004_auto_20160912_1503.py
  17. 2
      sigi/apps/servidores/models.py
  18. 13
      sigi/apps/servidores/urls.py
  19. 37
      sigi/settings/base.py
  20. 1
      sigi/settings/dev.py
  21. 15
      sigi/urls.py

4
moodlerouter.py

@ -18,7 +18,7 @@ class MoodleRouter(object):
return True return True
return None return None
def allow_migrate(self, db, model): def allow_migrate(self, db, app_label, model_name=None, **hints):
if model._meta.app_label == 'mdl': if app_label == 'mdl':
return False return False
return None return None

38
sigi/apps/casas/urls.py

@ -1,37 +1,37 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from sigi.apps.casas import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.casas.views',
# Informacoes de uma casa legislativa # Informacoes de uma casa legislativa
url(r'^casalegislativa/report_complete/$', 'report_complete', name='report-complete-all'), url(r'^casalegislativa/report_complete/$', views.report_complete, name='report-complete-all'),
url(r'^casalegislativa/(?P<id>\w+)/report_complete/$', 'report_complete', name='report-complete-id'), url(r'^casalegislativa/(?P<id>\w+)/report_complete/$', views.report_complete, name='report-complete-id'),
# Reports Labels # Reports Labels
url(r'^casalegislativa/labels/$', 'labels_report', name='labels-report-all'), url(r'^casalegislativa/labels/$', views.labels_report, name='labels-report-all'),
url(r'^casalegislativa/(?P<id>\w+)/labels/$', 'labels_report', name='labels-report-id'), url(r'^casalegislativa/(?P<id>\w+)/labels/$', views.labels_report, name='labels-report-id'),
# Reports Labels Parlamentar # Reports Labels Parlamentar
url(r'^casalegislativa/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), url(r'^casalegislativa/labels_parlamentar/$', views.labels_report_parlamentar, name='lebels-report-parlamentar-all'),
url(r'^casalegislativa/(?P<id>\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), url(r'^casalegislativa/(?P<id>\w+)/labels_parlamentar/$', views.labels_report_parlamentar, name='labels-report-parlamentar-id'),
# Reports labels sem presidente # Reports labels sem presidente
url(r'^casalegislativa/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), url(r'^casalegislativa/labels_sem_presidente/$', views.labels_report_sem_presidente, name='labels-report-sem-presidente-all'),
url(r'^casalegislativa/(?P<id>\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), url(r'^casalegislativa/(?P<id>\w+)/labels_sem_presidente/$', views.labels_report_sem_presidente, name='labels-report-sem-presidente-id'),
# Reports casas sem convenio # Reports casas sem convenio
url(r'^casalegislativa/reports/$', 'report', name='casa-report'), url(r'^casalegislativa/reports/$', views.report, name='casa-report'),
url(r'^casalegislativa/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), url(r'^casalegislativa/casas_sem_convenio_report/$', views.casas_sem_convenio_report, name='casas-sem-convenio-report'),
# CSV # CSV
url(r'^casalegislativa/csv/$', 'export_csv', name='casa-export-csv'), # Error url(r'^casalegislativa/csv/$', views.export_csv, name='casa-export-csv'), # Error
# Carrinho # Carrinho
url(r'^casalegislativa/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^casalegislativa/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^casalegislativa/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error url(r'^casalegislativa/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # Error
url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # Error
url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), url(r'^portfolio/$', views.portfolio, name='casas-portfolio'),
url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), url(r'^carteira/$', views.painel_relacionamento, name='casas-carteira'),
) ]

21
sigi/apps/convenios/urls.py

@ -1,13 +1,12 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.convenios import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.convenios.views', url(r'^convenio/reports/$', views.report, name='convenios-report'),
url(r'^convenio/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^convenio/reports/$', 'report', name='convenios-report'), url(r'^convenio/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # tagerror
url(r'^convenio/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^convenio/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # tagerror
url(r'^convenio/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # tagerror url(r'^convenio/csv/$', views.export_csv, name='convenios-csv'),
url(r'^convenio/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # tagerror url(r'^reportsRegiao/(?P<regiao>\w+)/$', views.report_regiao, name='convenios-report_regiao_pdf'),
url(r'^convenio/csv/$', 'export_csv', name='convenios-csv'), ]
url(r'^reportsRegiao/(?P<regiao>\w+)/$', 'report_regiao', name='convenios-report_regiao_pdf'),
)

56
sigi/apps/diagnosticos/urls.py

@ -1,51 +1,57 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url from django.conf.urls import url
from django.views.generic import TemplateView from django.views.generic import TemplateView
from sigi.apps.diagnosticos import views as diagnosticos_views
from django.contrib.auth import views as auth_views
LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login'
urlpatterns = patterns(
'sigi.apps.diagnosticos.views',
urlpatterns = [
# Lista de Diagnósticos # Lista de Diagnósticos
url(r'^mobile/$', 'lista', name='lista_diagnosticos'), url(r'^mobile/$', diagnosticos_views.lista, name='lista_diagnosticos'),
# Lista de Categorias # Lista de Categorias
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/$',
'categorias', name='lista_categorias'), diagnosticos_views.categorias, name='lista_categorias'),
# Detalhes da Categoria da Casa Legislativa # Detalhes da Categoria da Casa Legislativa
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/1/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/1/$',
'categoria_casa_legislativa', name='detalhes_categoria_casa_legislativa'), diagnosticos_views.categoria_casa_legislativa,
name='detalhes_categoria_casa_legislativa'),
# Detalhes da Categoria de Contatos # Detalhes da Categoria de Contatos
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/2/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/2/$',
'categoria_contatos', name='detalhes_categoria_contatos'), diagnosticos_views.categoria_contatos,
name='detalhes_categoria_contatos'),
# Detalhes de Categorias Dinamicas # Detalhes de Categorias Dinamicas
url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/(?P<id_categoria>\d+)/$', url(r'^mobile/(?P<id_diagnostico>\d+)/categorias/(?P<id_categoria>\d+)/$',
'categoria_detalhes', name='detalhes_categoria'), diagnosticos_views.categoria_detalhes, name='detalhes_categoria'),
url(r'^mapa/$', TemplateView.as_view(template_name="diagnosticos/mapa.html"), name='template-mapa'), url(r'^mapa/$',
url(r'^mundiagjson/$', 'municipios_diagnosticados', name='municipios-diagnosticados'), TemplateView.as_view(template_name="diagnosticos/mapa.html"),
name='template-mapa'),
url(r'^mundiagjson/$', diagnosticos_views.municipios_diagnosticados,
name='municipios-diagnosticados'),
# Reports diagnosticos # Reports diagnosticos
url(r'^diagnostico/(?P<id_diagnostico>\w+).pdf$', 'diagnostico_pdf', name='diagnostico-pdf'), url(r'^diagnostico/(?P<id_diagnostico>\w+).pdf$',
diagnosticos_views.diagnostico_pdf, name='diagnostico-pdf'),
# Graficos de perguntas # Graficos de perguntas
url(r'^graficos/$', 'graficos', name="diagnosticos-graficos"), # tagerror url(r'^graficos/$', diagnosticos_views.graficos,
url(r'^api/$', 'grafico_api', name="diagnosticos-grafico-api"), # tagerror name="diagnosticos-graficos"), # tagerror
url(r'^api/$', diagnosticos_views.grafico_api,
) name="diagnosticos-grafico-api"), # tagerror
]
urlpatterns += patterns(
'django.contrib.auth.views',
urlpatterns += [
# Login do Diagnóstico # Login do Diagnóstico
url(r'^mobile/login/$', 'login', {'template_name': url(r'^mobile/login/$',
'diagnosticos/diagnosticos_login.html'}, name='login'), auth_views.login, {'template_name':
'diagnosticos/diagnosticos_login.html'},
name='login'),
# Logout do Diagnóstico # Logout do Diagnóstico
url(r'^mobile/logout/$', 'logout', url(r'^mobile/logout/$', auth_views.logout,
{'next_page': LOGIN_REDIRECT_URL}, name='logout'), {'next_page': diagnosticos_views.LOGIN_REDIRECT_URL}, name='logout'),
) ]

2
sigi/apps/diagnosticos/views.py

@ -15,10 +15,10 @@ from sigi.apps.diagnosticos.forms import (CasaLegislativaMobileForm,
DiagnosticoMobileForm, DiagnosticoMobileForm,
FuncionariosMobileForm) FuncionariosMobileForm)
from sigi.apps.diagnosticos.models import Categoria, Diagnostico, Pergunta from sigi.apps.diagnosticos.models import Categoria, Diagnostico, Pergunta
from sigi.apps.diagnosticos.urls import LOGIN_REDIRECT_URL
from sigi.apps.utils.decorators import login_required from sigi.apps.utils.decorators import login_required
from sigi.shortcuts import render_to_pdf from sigi.shortcuts import render_to_pdf
LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login'
@never_cache @never_cache
@login_required(login_url=LOGIN_REDIRECT_URL) @login_required(login_url=LOGIN_REDIRECT_URL)

12
sigi/apps/eventos/urls.py

@ -1,9 +1,9 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.eventos import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.eventos.views',
# Painel de ocorrencias # Painel de ocorrencias
url(r'^calendario/$', 'calendario', name='eventos-calendario'), url(r'^calendario/$', views.calendario, name='eventos-calendario'),
url(r'^alocacaoequipe/$', 'alocacao_equipe', name='eventos-alocacaoequipe'), url(r'^alocacaoequipe/$', views.alocacao_equipe, name='eventos-alocacaoequipe'),
) ]

22
sigi/apps/home/urls.py

@ -1,22 +1,22 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from sigi.apps.home import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.home.views',
url(r'^atendimento', TemplateView.as_view( url(r'^atendimento', TemplateView.as_view(
template_name='index_atendimento.html'), template_name='index_atendimento.html'),
name='index_atendimento'), name='index_atendimento'),
url(r'^$', 'index', name='sigi_index'), url(r'^$', views.index, name='sigi_index'),
url(r'^home/resumoconvenios/$', 'resumo_convenios', url(r'^home/resumoconvenios/$', views.resumo_convenios,
name="home_resumoconvenios"), name="home_resumoconvenios"),
url(r'^home/resumoseit/$', 'resumo_seit', name="home_resumoseit"), url(r'^home/resumoseit/$', views.resumo_seit, name="home_resumoseit"),
url(r'^home/chartseit/$', 'chart_seit', name="home_chartseit"), url(r'^home/chartseit/$', views.chart_seit, name="home_chartseit"),
url(r'^home/chartconvenios/$', 'chart_convenios', url(r'^home/chartconvenios/$', views.chart_convenios,
name="home_chartconvenios"), name="home_chartconvenios"),
url(r'^home/chartcarteira/$', 'chart_carteira', name="home_chartcarteira"), url(r'^home/chartcarteira/$', views.chart_carteira, name="home_chartcarteira"),
url(r'^home/chartperformance/$', 'chart_performance', url(r'^home/chartperformance/$', views.chart_performance,
name="home_chartperformance"), name="home_chartperformance"),
url(r'^home/report/semconvenio/$', 'report_sem_convenio', url(r'^home/report/semconvenio/$', views.report_sem_convenio,
name="home_reportsemconvenio"), name="home_reportsemconvenio"),
) ]

2
sigi/apps/mdl/models.py

@ -40,7 +40,7 @@ class CourseStats(models.Model):
('A', u'Aprovação'), ('A', u'Aprovação'),
('I', u'Indeterminado'),) ('I', u'Indeterminado'),)
category = models.ForeignKey('CourseCategories', db_column='categoryid', primary_key=True) category = models.ForeignKey('CourseCategories', db_column='categoryid')
course = models.ForeignKey('Course', db_column='courseid') course = models.ForeignKey('Course', db_column='courseid')
completionstatus = models.CharField(max_length=1, choices=COMPLETIONSTATUS_CHOICES) completionstatus = models.CharField(max_length=1, choices=COMPLETIONSTATUS_CHOICES)
usercount = models.IntegerField() usercount = models.IntegerField()

20
sigi/apps/metas/urls.py

@ -1,13 +1,13 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.metas import views
urlpatterns = patterns(
'sigi.apps.metas.views',
url(r'^$', 'dashboard', name='metas-dashboardsss'), # tagerror urlpatterns = [
url(r'^mapa/$', 'mapa', name='metas-mapa'), # tagerror url(r'^$', views.dashboard, name='metas-dashboardsss'), # tagerror
url(r'^mapdata/$', 'map_data', name='metas-map_data'), url(r'^mapa/$', views.mapa, name='metas-mapa'), # tagerror
url(r'^mapsearch/$', 'map_search', name='metas-map_search'), url(r'^mapdata/$', views.map_data, name='metas-map_data'),
url(r'^mapsum/$', 'map_sum', name='metas-map_sum'), url(r'^mapsearch/$', views.map_search, name='metas-map_search'),
url(r'^maplist/$', 'map_list', name='metas-map_list'), url(r'^mapsum/$', views.map_sum, name='metas-map_sum'),
) url(r'^maplist/$', views.map_list, name='metas-map_list'),
]

28
sigi/apps/ocorrencias/urls.py

@ -1,18 +1,18 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from sigi.apps.ocorrencias import views
urlpatterns = patterns( urlpatterns = [
'sigi.apps.ocorrencias.views',
# Painel de ocorrencias # Painel de ocorrencias
url(r'^painel/$', 'painel_ocorrencias', name='painel-ocorrencias'), url(r'^painel/$', views.painel_ocorrencias, name='painel-ocorrencias'),
url(r'^painel/buscanominal/$', 'busca_nominal', {"origin": "tudo"}, name='painel-buscanominal'), url(r'^painel/buscanominal/$', views.busca_nominal, {"origin": "tudo"}, name='painel-buscanominal'),
url(r'^painel/buscanominal/casa/$', 'busca_nominal', {"origin": "casa"}, name='painel-buscacasa'), url(r'^painel/buscanominal/casa/$', views.busca_nominal, {"origin": "casa"}, name='painel-buscacasa'),
url(r'^painel/buscanominal/servidor/$', 'busca_nominal', {"origin": "servidor"}, name='painel-buscaservidor'), url(r'^painel/buscanominal/servidor/$', views.busca_nominal, {"origin": "servidor"}, name='painel-buscaservidor'),
url(r'^painel/buscanominal/servico/$', 'busca_nominal', {"origin": "servico"}, name='painel-buscaservico'), url(r'^painel/buscanominal/servico/$', views.busca_nominal, {"origin": "servico"}, name='painel-buscaservico'),
url(r'^mudaprioridade/$', 'muda_prioridade', name='ocorrencia-mudaprioridade'), url(r'^mudaprioridade/$', views.muda_prioridade, name='ocorrencia-mudaprioridade'),
url(r'^excluianexo/$', 'exclui_anexo', name='ocorrencia-excluianexo'), url(r'^excluianexo/$', views.exclui_anexo, name='ocorrencia-excluianexo'),
url(r'^incluianexo/$', 'inclui_anexo', name='ocorrencia-incluianexo'), url(r'^incluianexo/$', views.inclui_anexo, name='ocorrencia-incluianexo'),
url(r'^anexosnippet/$', 'anexo_snippet', name='ocorrencia-anexosnippet'), url(r'^anexosnippet/$', views.anexo_snippet, name='ocorrencia-anexosnippet'),
url(r'^incluicomentario/$', 'inclui_comentario', name='ocorrencia-incluicomentario'), url(r'^incluicomentario/$', views.inclui_comentario, name='ocorrencia-incluicomentario'),
url(r'^incluiocorrencia/$', 'inclui_ocorrencia', name='ocorrencia-incluiocorrencia'), url(r'^incluiocorrencia/$', views.inclui_ocorrencia, name='ocorrencia-incluiocorrencia'),
) ]

19
sigi/apps/parlamentares/urls.py

@ -1,17 +1,16 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.parlamentares import views
urlpatterns = patterns(
'sigi.apps.parlamentares.views',
urlpatterns = [
# Reports labels parlamentares # Reports labels parlamentares
url(r'^parlamentar/labels/$', 'labels_report', name='labels-report-all'), url(r'^parlamentar/labels/$', views.labels_report, name='labels-report-all'),
url(r'^parlamentar/(?P<id>\w+)/labels/$', 'labels_report', name='labels-report-id'), url(r'^parlamentar/(?P<id>\w+)/labels/$', views.labels_report, name='labels-report-id'),
# Carrinho # Carrinho
url(r'^parlamentar/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^parlamentar/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^parlamentar/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), url(r'^parlamentar/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'),
# A view excluir_carrinho n existe ainda. # A view excluir_carrinho n existe ainda.
# url(r'^parlamentar/carrinho/exluir_carrinho$', 'excluir_carrinho', name='excluir-carrinho'), # url(r'^parlamentar/carrinho/exluir_carrinho$', views.excluir_carrinho, name='excluir-carrinho'),
) ]

19
sigi/apps/saberes/urls.py

@ -1,14 +1,11 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.saberes import views
from .views import (cursos_com_tutoria, cursos_sem_tutoria, dashboard,
pentaho_proxy)
urlpatterns = patterns( urlpatterns = [
'sigi.apps.saberes.views', url(r'^dashboard/cursos-sem-turoria/?$', views.cursos_sem_tutoria, name="saberes-cursos-sem-tutoria"),
url(r'^dashboard/cursos-com-turoria/?$', views.cursos_com_tutoria, name="saberes-cursos-com-tutoria"),
url(r'^dashboard/cursos-sem-turoria/?$', cursos_sem_tutoria, name="saberes-cursos-sem-tutoria"), url(r'^dashboard/?$', views.dashboard, name="saberes-dashboard-view"),
url(r'^dashboard/cursos-com-turoria/?$', cursos_com_tutoria, name="saberes-cursos-com-tutoria"), url(r'^(?P<path>(plugin|api)/.*)$', views.pentaho_proxy),
url(r'^dashboard/?$', dashboard, name="saberes-dashboard-view"), ]
url(r'^(?P<path>(plugin|api)/.*)$', pentaho_proxy),
)

21
sigi/apps/servicos/migrations/0005_auto_20160912_1503.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-09-12 15:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('servicos', '0004_auto_20160623_0829'),
]
operations = [
migrations.AlterField(
model_name='casamanifesta',
name='casa_legislativa',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='casas.CasaLegislativa'),
),
]

2
sigi/apps/servicos/models.py

@ -195,7 +195,7 @@ class CasaAtendida(CasaLegislativa):
class CasaManifesta(models.Model): class CasaManifesta(models.Model):
casa_legislativa = models.OneToOneField(CasaLegislativa) casa_legislativa = models.ForeignKey(CasaLegislativa)
data_manifestacao = models.DateTimeField(auto_now_add=True) data_manifestacao = models.DateTimeField(auto_now_add=True)
data_atualizacao = models.DateTimeField(auto_now=True) data_atualizacao = models.DateTimeField(auto_now=True)
informante = models.CharField(_(u'Nome do informante'), max_length=100, blank=True) informante = models.CharField(_(u'Nome do informante'), max_length=100, blank=True)

14
sigi/apps/servicos/urls.py

@ -1,14 +1,14 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, url from django.conf.urls import url
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from .views import MapaView from .views import MapaView
from sigi.apps.servicos import views
urlpatterns = patterns(
'sigi.apps.servicos.views',
url(r'^manifesta/$', 'casa_manifesta_view', name="casa-manifesta-view"), urlpatterns = [
url(r'^munatenjson/(?P<servico>\w+)/$', 'municipios_atendidos', name="municipios-atendidos"), url(r'^manifesta/$', views.casa_manifesta_view, name="casa-manifesta-view"),
url(r'^munatenjson/(?P<servico>\w+)/$', views.municipios_atendidos, name="municipios-atendidos"),
url(r'^mapa/(?P<servico>\w+)/$', MapaView.as_view(), name="servicos-mapa"), url(r'^mapa/(?P<servico>\w+)/$', MapaView.as_view(), name="servicos-mapa"),
# url(r'^listacasas/(?P<sigla>\w+)', 'casas_usam_servico', name="casas-usam-servico"), # url(r'^listacasas/(?P<sigla>\w+)', views.casas_usam_servico, name="casas-usam-servico"),
) ]

22
sigi/apps/servidores/migrations/0004_auto_20160912_1503.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-09-12 15:03
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('servidores', '0003_auto_20160811_1553'),
]
operations = [
migrations.AlterField(
model_name='servidor',
name='user',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]

2
sigi/apps/servidores/models.py

@ -63,7 +63,7 @@ class Servidor(models.Model):
) )
# usuario responsavel pela autenticação do servidor no sistema # usuario responsavel pela autenticação do servidor no sistema
user = models.ForeignKey(User, unique=True) user = models.OneToOneField(User)
nome_completo = models.CharField(max_length=128) nome_completo = models.CharField(max_length=128)
apelido = models.CharField(max_length=50, blank=True) apelido = models.CharField(max_length=50, blank=True)
# caminho no sistema para arquivo com a imagem # caminho no sistema para arquivo com a imagem

13
sigi/apps/servidores/urls.py

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url from django.conf.urls import url
from sigi.apps.servidores import views
urlpatterns = patterns(
'sigi.apps.servidores.views',
urlpatterns = [
# Reports servidores # Reports servidores
url(r'^servidores_por_funcao.pdf$', 'servidores_por_funcao', name='servidores-funcao-pdf'), url(r'^servidores_por_funcao.pdf$', views.servidores_por_funcao, name='servidores-funcao-pdf'),
url(r'^servidores_por_cargo.pdf$', 'servidores_por_cargo', name='servidores-cargo-pdf'), url(r'^servidores_por_cargo.pdf$', views.servidores_por_cargo, name='servidores-cargo-pdf'),
) ]

37
sigi/settings/base.py

@ -31,16 +31,6 @@ MANAGERS = ADMINS
SITE_ID = 1 SITE_ID = 1
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + [
'django.core.context_processors.request',
'sigi.context_processors.usuario_context'
]
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
# Database routers # Database routers
DATABASE_ROUTERS = ['moodlerouter.MoodleRouter', ] DATABASE_ROUTERS = ['moodlerouter.MoodleRouter', ]
@ -137,9 +127,30 @@ SERVER_EMAIL = 'sigi@interlegis.leg.br'
DEFAULT_FROM_EMAIL = 'spdt@interlegis.leg.br' DEFAULT_FROM_EMAIL = 'spdt@interlegis.leg.br'
EMAIL_SUBJECT_PREFIX = u'[SIGI]' EMAIL_SUBJECT_PREFIX = u'[SIGI]'
TEMPLATE_DIRS = ( TEMPLATES = [
os.path.join(BASE_DIR, 'templates'), {
) 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'sigi.context_processors.usuario_context'
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
]
},
},
]
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/' MEDIA_URL = '/media/'

1
sigi/settings/dev.py

@ -19,7 +19,6 @@ DATABASES = {
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
TEMPLATE_DEBUG = DEBUG
DEBUG_TOOLBAR_CONFIG = { DEBUG_TOOLBAR_CONFIG = {
'SHOW_TEMPLATE_CONTEXT': True, 'SHOW_TEMPLATE_CONTEXT': True,
} }

15
sigi/urls.py

@ -5,15 +5,14 @@ from django.conf.urls import include, patterns, url
from django.conf.urls.static import static from django.conf.urls.static import static
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 django.views.static import serve
from sigi.apps.saberes.views import pentaho_proxy from sigi.apps.saberes.views import pentaho_proxy
admin.site.index_template = 'index.html' admin.site.index_template = 'index.html'
admin.autodiscover() admin.autodiscover()
urlpatterns = patterns( urlpatterns = [
'',
url(r'^parlamentares/', include('sigi.apps.parlamentares.urls')), url(r'^parlamentares/', include('sigi.apps.parlamentares.urls')),
url(r'^casas/', include('sigi.apps.casas.urls')), url(r'^casas/', include('sigi.apps.casas.urls')),
url(r'^convenios/', include('sigi.apps.convenios.urls')), url(r'^convenios/', include('sigi.apps.convenios.urls')),
@ -38,15 +37,13 @@ urlpatterns = patterns(
# Suspended # Suspended
# url(r'^i18n/', include('django.conf.urls.i18n')), # url(r'^i18n/', include('django.conf.urls.i18n')),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
if settings.DEBUG: if settings.DEBUG:
urlpatterns = patterns( urlpatterns = [
'',
url(r'^404/$', TemplateView.as_view(template_name='404.html')), url(r'^404/$', TemplateView.as_view(template_name='404.html')),
url(r'^500/$', TemplateView.as_view(template_name='500.html')), url(r'^500/$', TemplateView.as_view(template_name='500.html')),
url(r'^503/$', TemplateView.as_view(template_name='503.html')), url(r'^503/$', TemplateView.as_view(template_name='503.html')),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', { url(r'^media/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT, }), 'document_root': settings.MEDIA_ROOT, }),
) + urlpatterns ] + urlpatterns

Loading…
Cancel
Save