Browse Source

Correct lots of deprecation warnings mainly in url.py files

Signed-off-by: Luciano Almeida <lucianoalmeida@interlegis.leg.br>
atualiza-django-1.10.5
Luciano Almeida 8 years ago
parent
commit
0f5701efbe
  1. 4
      moodlerouter.py
  2. 39
      sigi/apps/casas/urls.py
  3. 22
      sigi/apps/convenios/urls.py
  4. 55
      sigi/apps/diagnosticos/urls.py
  5. 9
      sigi/apps/diagnosticos/views.py
  6. 13
      sigi/apps/eventos/urls.py
  7. 30
      sigi/apps/home/urls.py
  8. 2
      sigi/apps/mdl/models.py
  9. 22
      sigi/apps/metas/urls.py
  10. 29
      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. 15
      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. 29
      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

39
sigi/apps/casas/urls.py

@ -1,38 +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 = [
urlpatterns = patterns(
'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'),
) ]

22
sigi/apps/convenios/urls.py

@ -1,14 +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 = [
urlpatterns = patterns( url(r'^convenio/reports/$', views.report, name='convenios-report'),
'sigi.apps.convenios.views', url(r'^convenio/carrinho/$', views.visualizar_carrinho, name='visualizar-carrinho'),
url(r'^convenio/carrinho/excluir_carrinho/$', views.excluir_carrinho, name='excluir-carrinho'), # tagerror
url(r'^convenio/reports/$', 'report', name='convenios-report'), url(r'^convenio/carrinho/deleta_itens_carrinho$', views.deleta_itens_carrinho, name='deleta-itens-carrinho'), # tagerror
url(r'^convenio/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), url(r'^convenio/csv/$', views.export_csv, name='convenios-csv'),
url(r'^convenio/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # tagerror url(r'^reportsRegiao/(?P<regiao>\w+)/$', views.report_regiao, name='convenios-report_regiao_pdf'),
url(r'^convenio/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # tagerror ]
url(r'^convenio/csv/$', 'export_csv', name='convenios-csv'),
url(r'^reportsRegiao/(?P<regiao>\w+)/$', 'report_regiao', name='convenios-report_regiao_pdf'),
)

55
sigi/apps/diagnosticos/urls.py

@ -1,52 +1,59 @@
# -*- 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' LOGIN_REDIRECT_URL = '/diagnosticos/mobile/login'
urlpatterns = patterns( urlpatterns = [
'sigi.apps.diagnosticos.views',
# 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'),
) ]

9
sigi/apps/diagnosticos/views.py

@ -11,13 +11,14 @@ from django.views.decorators.cache import never_cache
from sigi.apps.casas.models import Funcionario from sigi.apps.casas.models import Funcionario
from sigi.apps.contatos.models import Telefone from sigi.apps.contatos.models import Telefone
from sigi.apps.diagnosticos.decorators import validate_diagnostico from sigi.apps.diagnosticos.decorators import validate_diagnostico
from sigi.apps.diagnosticos.forms import (DiagnosticoMobileForm, from sigi.apps.diagnosticos.forms import (CasaLegislativaMobileForm,
CasaLegislativaMobileForm, FuncionariosMobileForm) DiagnosticoMobileForm,
from sigi.apps.diagnosticos.models import Diagnostico, Categoria, Pergunta FuncionariosMobileForm)
from sigi.apps.diagnosticos.urls import LOGIN_REDIRECT_URL from sigi.apps.diagnosticos.models import Categoria, Diagnostico, Pergunta
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)

13
sigi/apps/eventos/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.eventos import views
urlpatterns = [
urlpatterns = patterns(
'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'),
) ]

30
sigi/apps/home/urls.py

@ -1,15 +1,23 @@
# 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 sigi.apps.home import views
urlpatterns = patterns('sigi.apps.home.views', urlpatterns = [
url(r'^$', 'index', name='sigi_index'), url(r'^atendimento', TemplateView.as_view(
url(r'^home/resumoconvenios/$', 'resumo_convenios', name="home_resumoconvenios"), template_name='index_atendimento.html'),
url(r'^home/resumoseit/$', 'resumo_seit', name="home_resumoseit"), name='index_atendimento'),
url(r'^home/chartseit/$', 'chart_seit', name="home_chartseit"), url(r'^$', views.index, name='sigi_index'),
url(r'^home/chartconvenios/$', 'chart_convenios', name="home_chartconvenios"), url(r'^home/resumoconvenios/$', views.resumo_convenios,
url(r'^home/chartcarteira/$', 'chart_carteira', name="home_chartcarteira"), name="home_resumoconvenios"),
url(r'^home/chartperformance/$', 'chart_performance', name="home_chartperformance"), url(r'^home/resumoseit/$', views.resumo_seit, name="home_resumoseit"),
url(r'^home/report/semconvenio/$', 'report_sem_convenio', name="home_reportsemconvenio"), url(r'^home/chartseit/$', views.chart_seit, name="home_chartseit"),
url(r'^home/chartconvenios/$', views.chart_convenios,
) name="home_chartconvenios"),
url(r'^home/chartcarteira/$', views.chart_carteira, name="home_chartcarteira"),
url(r'^home/chartperformance/$', views.chart_performance,
name="home_chartperformance"),
url(r'^home/report/semconvenio/$', views.report_sem_convenio,
name="home_reportsemconvenio"),
]

2
sigi/apps/mdl/models.py

@ -39,7 +39,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()

22
sigi/apps/metas/urls.py

@ -1,14 +1,12 @@
# 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 = [
urlpatterns = patterns( url(r'^$', views.dashboard, name='metas-dashboardsss'), # tagerror
'sigi.apps.metas.views', url(r'^mapa/$', views.mapa, name='metas-mapa'), # tagerror
url(r'^mapdata/$', views.map_data, name='metas-map_data'),
url(r'^$', 'dashboard', name='metas-dashboardsss'), # tagerror url(r'^mapsearch/$', views.map_search, name='metas-map_search'),
url(r'^mapa/$', 'mapa', name='metas-mapa'), # tagerror url(r'^mapsum/$', views.map_sum, name='metas-map_sum'),
url(r'^mapdata/$', 'map_data', name='metas-map_data'), url(r'^maplist/$', views.map_list, name='metas-map_list'),
url(r'^mapsearch/$', 'map_search', name='metas-map_search'), ]
url(r'^mapsum/$', 'map_sum', name='metas-map_sum'),
url(r'^maplist/$', 'map_list', name='metas-map_list'),
)

29
sigi/apps/ocorrencias/urls.py

@ -1,19 +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 = [
urlpatterns = patterns(
'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_sem_tutoria, cursos_com_tutoria, dashboard, pentaho_proxy
urlpatterns = [
urlpatterns = patterns( url(r'^dashboard/cursos-sem-turoria/?$', views.cursos_sem_tutoria, name="saberes-cursos-sem-tutoria"),
'sigi.apps.saberes.views', url(r'^dashboard/cursos-com-turoria/?$', views.cursos_com_tutoria, name="saberes-cursos-com-tutoria"),
url(r'^dashboard/?$', views.dashboard, name="saberes-dashboard-view"),
url(r'^dashboard/cursos-sem-turoria/?$', cursos_sem_tutoria, name="saberes-cursos-sem-tutoria"), url(r'^(?P<path>(plugin|api)/.*)$', views.pentaho_proxy),
url(r'^dashboard/cursos-com-turoria/?$', cursos_com_tutoria, name="saberes-cursos-com-tutoria"), ]
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

@ -193,7 +193,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)

15
sigi/apps/servicos/urls.py

@ -1,15 +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( urlpatterns = [
'sigi.apps.servicos.views', 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'^manifesta/$', 'casa_manifesta_view', name="casa-manifesta-view"),
url(r'^munatenjson/(?P<servico>\w+)/$', '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,11 +1,10 @@
# -*- 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( urlpatterns = [
'sigi.apps.servidores.views',
# 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'),
) ]

29
sigi/settings/base.py

@ -32,7 +32,9 @@ SITE_ID = 1
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + [ TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + [
'django.core.context_processors.request', 'django.core.context_processors.request',
'sigi.context_processors.usuario_context'
] ]
# List of callables that know how to import templates from various sources. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader', TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader', 'django.template.loaders.app_directories.Loader',
@ -121,9 +123,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

@ -4,6 +4,7 @@ from django.conf.urls import patterns, include, 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
@ -11,9 +12,7 @@ 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')),
@ -33,15 +32,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