From 1f03796a668ca54f3ce601e86dc4cf75f84475ff Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Fri, 7 Apr 2017 12:13:10 -0300 Subject: [PATCH 01/69] Correct improperly Servico cascade deletion when Funcionario was removed --- .../migrations/0003_auto_20170407_1003.py | 27 +++++++++++++++++++ sigi/apps/servicos/models.py | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 sigi/apps/servicos/migrations/0003_auto_20170407_1003.py diff --git a/sigi/apps/servicos/migrations/0003_auto_20170407_1003.py b/sigi/apps/servicos/migrations/0003_auto_20170407_1003.py new file mode 100644 index 0000000..26fa40f --- /dev/null +++ b/sigi/apps/servicos/migrations/0003_auto_20170407_1003.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servicos', '0002_tiposervico_modo'), + ] + + operations = [ + migrations.AlterField( + model_name='servico', + name='contato_administrativo', + field=models.ForeignKey(related_name='contato_administrativo', on_delete=django.db.models.deletion.PROTECT, verbose_name='Contato administrativo', to='casas.Funcionario'), + preserve_default=True, + ), + migrations.AlterField( + model_name='servico', + name='contato_tecnico', + field=models.ForeignKey(related_name='contato_tecnico', on_delete=django.db.models.deletion.PROTECT, verbose_name='Contato t\xe9cnico', to='casas.Funcionario'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index 6a9cde7..02c228c 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -39,8 +39,8 @@ class TipoServico(models.Model): class Servico(models.Model): casa_legislativa = models.ForeignKey(CasaLegislativa, verbose_name=_(u'Casa Legislativa')) tipo_servico = models.ForeignKey(TipoServico, verbose_name=_(u'Tipo de serviço')) - contato_tecnico = models.ForeignKey(Funcionario, verbose_name=_(u'Contato técnico'), related_name='contato_tecnico') - contato_administrativo = models.ForeignKey(Funcionario, verbose_name=_(u'Contato administrativo'), related_name='contato_administrativo') + contato_tecnico = models.ForeignKey(Funcionario, verbose_name=_(u'Contato técnico'), related_name='contato_tecnico', on_delete=models.PROTECT) + contato_administrativo = models.ForeignKey(Funcionario, verbose_name=_(u'Contato administrativo'), related_name='contato_administrativo', on_delete=models.PROTECT) url = models.URLField(_(u'URL do serviço'), blank=True) hospedagem_interlegis = models.BooleanField(_(u'Hospedagem no Interlegis?'), default=False) nome_servidor = models.CharField(_(u'Hospedado em'), max_length=60, blank=True, From 8cbc17c91397e0eb9ed4a668e1aa410f3abb3c7d Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Fri, 7 Apr 2017 12:15:22 -0300 Subject: [PATCH 02/69] Correct ContatoInline contact list to display in CasaAtendidaAdmin --- sigi/apps/servicos/admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index cecc0a8..74f5765 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -170,7 +170,9 @@ class ServicoAdmin(BaseModelAdmin): class ContatosInline(FuncionariosInline): can_delete = False # Equipe do SEIT não pode excluir pessoas de contato - + # SEIT see all contacts, including President + def get_queryset(self, request): + return self.model.objects.all() class CasaAtendidaAdmin(BaseModelAdmin): actions = None From e1d4577f01e46ef81112821129841a871ea60775 Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Fri, 7 Apr 2017 12:29:39 -0300 Subject: [PATCH 03/69] Old model changes that has not the appropriate migration --- .../migrations/0002_auto_20170407_1024.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sigi/apps/diagnosticos/migrations/0002_auto_20170407_1024.py diff --git a/sigi/apps/diagnosticos/migrations/0002_auto_20170407_1024.py b/sigi/apps/diagnosticos/migrations/0002_auto_20170407_1024.py new file mode 100644 index 0000000..68be0de --- /dev/null +++ b/sigi/apps/diagnosticos/migrations/0002_auto_20170407_1024.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import autoslug.fields +import eav.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('diagnosticos', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='pergunta', + name='name', + field=autoslug.fields.AutoSlugField(populate_from=b'title', editable=True, max_length=250, blank=True, verbose_name='name', slugify=eav.models.slugify_attr_name), + preserve_default=True, + ), + ] From 2afcb89ace6e524c85722d09277722c9256f19a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 5 Feb 2019 14:19:24 -0200 Subject: [PATCH 04/69] =?UTF-8?q?Corrige=20bug=20caso=20Casa=20n=C3=A3o=20?= =?UTF-8?q?tenha=20gerente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/home/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigi/apps/home/views.py b/sigi/apps/home/views.py index bef5f52..1e92734 100644 --- a/sigi/apps/home/views.py +++ b/sigi/apps/home/views.py @@ -126,9 +126,9 @@ def chart_carteira(request): 'data': [{'value': r['total_casas'], 'color': colors.next(), 'highlight': highlights.next(), - 'label': Servidor.objects.get(pk=r['gerente_contas']).nome_completo + 'label': r['gerente_contas__nome_completo'] } - for r in CasaLegislativa.objects.all().values('gerente_contas').annotate(total_casas=Count('pk')).order_by('gerente_contas') + for r in CasaLegislativa.objects.all().values('gerente_contas__nome_completo').annotate(total_casas=Count('pk')).order_by('gerente_contas__nome_completo') ] } From 05f935813967697174d48963cf863453a840c06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 29 May 2019 11:48:10 -0300 Subject: [PATCH 05/69] =?UTF-8?q?Melhorias=20nos=20filtros=20dos=20conv?= =?UTF-8?q?=C3=AAnios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 6eeac0b..a77ed1e 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -59,7 +59,7 @@ class ConvenioAdmin(BaseModelAdmin): 'projeto', ) list_display_links = ('num_convenio', 'casa_legislativa',) - list_filter = ('projeto', 'casa_legislativa__municipio__uf', 'casa_legislativa', 'conveniada', 'equipada') + list_filter = ('projeto', 'casa_legislativa__tipo', 'conveniada', 'equipada', 'casa_legislativa__municipio__uf', ) #date_hierarchy = 'data_adesao' ordering = ('casa_legislativa__tipo__sigla', 'casa_legislativa__municipio__uf', 'casa_legislativa') raw_id_fields = ('casa_legislativa',) From 3e14232c7b8440b4e96cc5634023fe3a88b711e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 13 Jun 2019 18:24:49 -0300 Subject: [PATCH 06/69] =?UTF-8?q?Refatora=20relat=C3=B3rio=20completo=20de?= =?UTF-8?q?=20Casa=20para=20usar=20Pisa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/reports.py | 288 +----------------- .../templates/casas/report_complete_pdf.html | 237 ++++++++++++++ sigi/apps/casas/views.py | 88 +++--- 3 files changed, 278 insertions(+), 335 deletions(-) create mode 100644 sigi/apps/casas/templates/casas/report_complete_pdf.html diff --git a/sigi/apps/casas/reports.py b/sigi/apps/casas/reports.py index 2c7a043..d94a3fa 100644 --- a/sigi/apps/casas/reports.py +++ b/sigi/apps/casas/reports.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -from django.templatetags.static import static -from django.utils.translation import ugettext as _ from geraldo import Report, DetailBand, Label, ObjectValue, ReportGroup, ReportBand, landscape, SubReport, BAND_WIDTH, SystemField from geraldo.graphics import Image + +from django.templatetags.static import static +from django.utils.translation import ugettext as _ from reportlab.lib.enums import TA_CENTER from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm @@ -238,7 +239,6 @@ class CasasLegislativasReport(ReportDefault): top=label_top, ), - ] class band_page_footer(ReportDefault.band_page_footer): @@ -293,285 +293,3 @@ class CasasLegislativasReport(ReportDefault): class CasasSemConvenioReport(CasasLegislativasReport): title = _(u'Relatório de Casas Legislativas sem Convênio') - - -class InfoCasaLegislativa(ReportDefault): - title = _(u'Casa Legislativa') - - class band_summary(ReportBand): - pass - - class band_page_footer(ReportBand): - height = 1 * cm - - elements = [ - SystemField(expression=_(u'%(now:%d/%m/%Y)s às %(now:%H:%M)s'), top=0.3 * cm), - ] - - class band_detail(ReportDefault.band_detail): - - posicao_left = [ - 0, 1.3, # Tipo - 0, 1.8, # Regiao - 5.5, 6.8, # U.F. - 0, 2.3, # Municipio - 0, 2.4, # Endereco - 0, 1.6, # Bairro - 0, 1.3, # CEP - 0, 1.6, # CNPJ - 0, 2.3, # Telefone - 0, 2.7, # Presidente - ] - posicao_top = [ - 0.5, # Tipo - 1.3, # Regiao - 1.3, # U.F. - 2.1, # Municipio - 2.9, # Logradouro - 3.7, # Bairro - 4.5, # CEP - 5.3, # CNPJ - 6.1, # Telefone - 6.9, # Presidente - ] - - height = 30 * cm - - display_inline = True - default_style = {'fontName': 'Helvetica', 'fontSize': 14} - - elements = [ - - Label( - text=label_text(_(u"Tipo")), - left=posicao_left[0] * cm, - top=posicao_top[0] * cm, - ), - ObjectValue( - attribute_name='tipo.nome', - left=posicao_left[1] * cm, - top=posicao_top[0] * cm, - width=6 * cm, - ), - Label( - text=label_text(_(u"Região")), - left=posicao_left[2] * cm, - top=posicao_top[1] * cm, - ), - ObjectValue( - attribute_name='municipio.uf.regiao', - left=posicao_left[3] * cm, - top=posicao_top[1] * cm, - get_value=lambda instance: - {'SL': _(u'Sul'), 'SD': _(u'Sudeste'), 'CO': _(u'Centro-Oeste'), 'NE': _(u'Nordeste'), 'NO': _(u'Norte'), } - [instance.municipio.uf.regiao] - ), - Label( - text=label_text(_(u"UF")), - left=posicao_left[4] * cm, - top=posicao_top[2] * cm, - ), - ObjectValue( - attribute_name='municipio.uf', - left=posicao_left[5] * cm, - top=posicao_top[2] * cm, - ), - Label( - text=label_text(_(u"Município")), - left=posicao_left[6] * cm, - top=posicao_top[3] * cm, - ), - ObjectValue( - attribute_name='municipio.nome', - left=posicao_left[7] * cm, - top=posicao_top[3] * cm, - width=20 * cm, - ), - # Linha 3 - Label( - text=label_text(_(u"Endereço")), - left=posicao_left[8] * cm, - top=posicao_top[4] * cm, - ), - ObjectValue( - attribute_name='logradouro', - left=posicao_left[9] * cm, - top=posicao_top[4] * cm, - width=20 * cm, - ), - Label( - text=label_text(_(u"Bairro")), - left=posicao_left[10] * cm, - top=posicao_top[5] * cm, - ), - ObjectValue( - attribute_name='bairro', - left=posicao_left[11] * cm, - top=posicao_top[5] * cm, - ), - Label( - text=label_text(_(u"CEP")), - left=posicao_left[12] * cm, - top=posicao_top[6] * cm, - ), - ObjectValue( - attribute_name='cep', - left=posicao_left[13] * cm, - top=posicao_top[6] * cm, - ), - Label( - text=label_text(_(u"CNPJ")), - left=posicao_left[14] * cm, - top=posicao_top[7] * cm, - ), - ObjectValue( - attribute_name='cnpj', - left=posicao_left[15] * cm, - top=posicao_top[7] * cm, - ), - Label( - text=label_text(_(u"Telefone")), - left=posicao_left[16] * cm, - top=posicao_top[8] * cm, - ), - ObjectValue( - attribute_name='telefone', - left=posicao_left[17] * cm, - top=posicao_top[8] * cm, - ), - Label( - text=label_text(_(u"Presidente")), - left=posicao_left[18] * cm, - top=posicao_top[9] * cm, - ), - ObjectValue( - attribute_name='presidente', - left=posicao_left[19] * cm, - top=posicao_top[9] * cm, - width=20 * cm, - ), - ] - # Telefones - tel_top = 2 * cm - tel_left = [0, 3, 5] - # Contato - cont_top = 2 * cm - cont_left = [0, 6, 9] - # Convenios - convenio_top = 2 * cm - convenio_left = [0, 1.8, 4.5, 8, 10.5, 13, 15.5, 18] - subreports = [ - # Telefones - SubReport( - queryset_string='%(object)s.telefones.all()', - band_header=ReportBand( - default_style={'fontName': 'Helvetica', 'fontSize': 12}, - height=2.5 * cm, - elements=[ - Label( - text=_(u"Telefone(s)"), - style={'fontSize': 14, 'alignment': TA_CENTER}, - width=BAND_WIDTH, - top=1 * cm, - ), - Label(text=_(u"Número"), left=tel_left[0] * cm, top=tel_top), - Label(text=_(u"Tipo"), left=tel_left[1] * cm, top=tel_top), - Label(text=_(u"Nota"), left=tel_left[2] * cm, top=tel_top), - ], - borders={'bottom': True}, - ), - band_detail=ReportBand( - default_style={'fontName': 'Helvetica', 'fontSize': 11}, - height=0.5 * cm, - elements=[ - ObjectValue(attribute_name='__unicode__', left=tel_left[0] * cm), - ObjectValue(attribute_name='tipo', left=tel_left[1] * cm, - get_value=lambda instance: - {'F': _(u'Fixo'), 'M': _(u'Móvel'), 'X': _(u'Fax'), 'I': _(u'Indefinido')}[instance.tipo], - ), - ObjectValue(attribute_name='nota', left=tel_left[2] * cm), - ], - #borders = {'all':True}, - ), - ), - # Contatos - SubReport( - queryset_string='%(object)s.funcionario_set.all()', - band_header=ReportBand( - default_style={'fontName': 'Helvetica', 'fontSize': 12}, - height=2.5 * cm, - elements=[ - Label( - text=_(u"Contato(s)"), - style={'fontSize': 14, 'alignment': TA_CENTER}, - width=BAND_WIDTH, - top=1 * cm, - ), - Label(text=_(u"Nome"), left=cont_left[0] * cm, top=cont_top), - Label(text=_(u"Nota"), left=cont_left[1] * cm, top=cont_top), - Label(text=_(u"E-mail"), left=cont_left[2] * cm, top=cont_top), - ], - borders={'bottom': True, 'top': True}, - ), - band_detail=ReportBand( - default_style={'fontName': 'Helvetica', 'fontSize': 11}, - height=0.5 * cm, - elements=[ - ObjectValue(attribute_name='nome', left=cont_left[0] * cm), - ObjectValue(attribute_name='nota', left=cont_left[1] * cm), - ObjectValue(attribute_name='email', left=cont_left[2] * cm), - ], - #borders = {'all':True}, - ), - ), - # Convenios - SubReport( - queryset_string='%(object)s.convenio_set.all()', - band_header=ReportBand( - default_style={'fontName': 'Helvetica', 'fontSize': 12}, - height=2.5 * cm, - elements=[ - Label( - text=_(u"Convênio(s)"), - style={'fontSize': 14, 'alignment': TA_CENTER}, - width=BAND_WIDTH, - top=1 * cm, - ), - Label(text=_(u"Projeto"), left=convenio_left[0] * cm, top=convenio_top), - Label(text=_(u"Nº Convenio"), left=convenio_left[1] * cm, top=convenio_top), - Label(text=_(u"Nº Processo SF"), left=convenio_left[2] * cm, top=convenio_top), - Label(text=_(u"Adesão"), left=convenio_left[3] * cm, top=convenio_top), - Label(text=_(u"Convênio"), left=convenio_left[4] * cm, top=convenio_top), - Label(text=_(u"Equipada"), left=convenio_left[5] * cm, top=convenio_top), - Label(text=_(u"Data D.O."), left=convenio_left[6] * cm, top=convenio_top), - ], - borders={'bottom': True} - ), - band_detail=ReportBand( - default_style={'fontName': 'Helvetica', 'fontSize': 11}, - height=0.5 * cm, - elements=[ - ObjectValue(attribute_name='projeto.sigla', left=convenio_left[0] * cm), - ObjectValue(attribute_name='num_convenio', left=convenio_left[1] * cm), - ObjectValue(attribute_name='num_processo_sf', left=convenio_left[2] * cm), - ObjectValue(attribute_name='data_adesao', left=convenio_left[3] * cm, - get_value=lambda instance: - instance.data_adesao.strftime('%d/%m/%Y') if instance.data_adesao is not None else '-' - ), - ObjectValue(attribute_name='data_retorno_assinatura', left=convenio_left[4] * cm, - get_value=lambda instance: - instance.data_retorno_assinatura.strftime('%d/%m/%Y') if instance.data_retorno_assinatura is not None else '-' - ), - ObjectValue(attribute_name='data_termo_aceite', left=convenio_left[5] * cm, - get_value=lambda instance: - instance.data_termo_aceite.strftime('%d/%m/%Y') if instance.data_termo_aceite is not None else '-' - ), - ObjectValue(attribute_name='data_pub_diario', left=convenio_left[6] * cm, - get_value=lambda instance: - instance.data_pub_diario.strftime('%d/%m/%Y') if instance.data_pub_diario is not None else '-' - ), - ], - #borders = {'all':True}, - ), - ) - ] diff --git a/sigi/apps/casas/templates/casas/report_complete_pdf.html b/sigi/apps/casas/templates/casas/report_complete_pdf.html new file mode 100644 index 0000000..284dfa0 --- /dev/null +++ b/sigi/apps/casas/templates/casas/report_complete_pdf.html @@ -0,0 +1,237 @@ +{% load smart_if %} +{% load static from staticfiles %} +{% load i18n %} + + + + + Casa Legislativa + + + + + + {% for casa in casas %} +
+

{{ casa.nome }}

+ + + + + + + + + + + +
{% trans 'Presidente:' %}{{ casa.presidente }}
{% trans 'Tipo:' %}{{ casa.tipo.nome }}
{% trans 'Estado / região:' %}{{ casa.municipio.uf.nome }} / {{ casa.municipio.uf.get_regiao_display }}
{% trans 'Município:' %}{{ casa.municipio.nome }}
{% trans 'Endereço:' %}{{ casa.logradouro }}
{% trans 'Bairro:' %}{{ casa.bairro }}
{% trans 'CEP:' %}{{ casa.cep }}
{% trans 'CNPJ:' %}{{ casa.cnpj }}
{% trans 'Telefone:' %}{{ casa.telefone }}
{% trans 'E-mail:' %}{{ casa.email }}
+ +

Telefones

+ + + + + + + + + + {% for tel in casa.telefones.all %} + + + + + + {% endfor %} +
NúmeroTipoNota
{{ tel.numero }}{{ tel.get_tipo_display }}{{ tel.nota }}
+ +

Pessoas de contato

+ + + + + + + + + + + {% for func in casa.funcionario_set.all %} + + + + + + + {% endfor %} +
NomeE-mailSetorNotas
{{ func.nome }}{{ func.email }}{{ func.get_setor_display }}{{ func.nota }}
+ +

Convênios

+ + + + + + + + + + + + + + {% for conv in casa.convenio_set.all %} + + + + + + + + + + {% endfor %} +
ProjetoNº convênioNº processo SFAdesãoConvênioEquipadaPublicada
{{ conv.projeto.nome }}{{ conv.num_convenio|default_if_none:"-" }}{{ conv.num_processo_sf|default_if_none:"-" }}{{ conv.data_adesao|date:"SHORT_DATE_FORMAT" }}{{ conv.data_retorno_assinatura|date:"SHORT_DATE_FORMAT" }}{{ conv.equipada|yesno }}{{ conv.data_pub_diario|date:"SHORT_DATE_FORMAT" }}
+ +

Serviços Interlegis

+ + + + + + + + + + + {% for srv in casa.servico_set.all %} + + + + + + + {% endfor %} +
ServiçoEndereçoAtivado emDesativado em
{{ srv.tipo_servico.nome }}{{ srv.url|default_if_none:"-" }}{{ srv.data_ativacao|date:"SHORT_DATE_FORMAT" }}{{ srv.data_desativacao|date:"SHORT_DATE_FORMAT" }}
+ + +
+ {% endfor %} + + + + diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index d8cea61..97f5cdb 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -1,30 +1,31 @@ # -*- coding: utf-8 -*- import csv from functools import reduce +from geraldo.generators import PDFGenerator +from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, InvalidPage, EmptyPage -from django.http import HttpResponse, HttpResponseRedirect, Http404 +from django.db.models import Count, Q +from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _, ungettext -from geraldo.generators import PDFGenerator +from sigi.apps.casas.forms import PortfolioForm from sigi.apps.casas.models import CasaLegislativa -from sigi.apps.casas.reports import CasasLegislativasLabels, CasasLegislativasLabelsSemPresidente, CasasLegislativasReport, CasasSemConvenioReport, InfoCasaLegislativa -from sigi.apps.parlamentares.reports import ParlamentaresLabels +from sigi.apps.casas.reports import (CasasLegislativasLabels, + CasasLegislativasLabelsSemPresidente, + CasasLegislativasReport, + CasasSemConvenioReport) from sigi.apps.contatos.models import UnidadeFederativa, Mesorregiao, Microrregiao -from sigi.apps.casas.forms import PortfolioForm -from django.contrib.auth.decorators import login_required +from sigi.apps.ocorrencias.models import Ocorrencia +from sigi.apps.parlamentares.reports import ParlamentaresLabels from sigi.apps.servicos.models import TipoServico from sigi.apps.servidores.models import Servidor -from sigi.apps.ocorrencias.models import Ocorrencia -from django.db.models import Count, Q -from django.http.response import JsonResponse +from sigi.shortcuts import render_to_pdf # @param qs: queryset # @param o: (int) number of order field - - def query_ordena(qs, o): from sigi.apps.casas.admin import CasaLegislativaAdmin list_display = CasaLegislativaAdmin.list_display @@ -85,6 +86,7 @@ def adicionar_casas_carrinho(request, queryset=None, id=None): lista.append(id) request.session['carrinho_casas'] = lista + @login_required def visualizar_carrinho(request): @@ -117,12 +119,14 @@ def visualizar_carrinho(request): } ) + @login_required def excluir_carrinho(request): if 'carrinho_casas' in request.session: del request.session['carrinho_casas'] return HttpResponseRedirect('.') + @login_required def deleta_itens_carrinho(request): if request.method == 'POST': @@ -139,6 +143,7 @@ def deleta_itens_carrinho(request): return HttpResponseRedirect('.') + @login_required def labels_report(request, id=None, tipo=None, formato='3x9_etiqueta'): """ TODO: adicionar suporte para resultado de pesquisa do admin. @@ -168,6 +173,7 @@ def labels_report(request, id=None, tipo=None, formato='3x9_etiqueta'): return response + @login_required def labels_report_parlamentar(request, id=None, formato='3x9_etiqueta'): """ TODO: adicionar suporte para resultado de pesquisa do admin. @@ -216,6 +222,7 @@ def carrinhoOrGet_for_parlamentar_qs(request): qs = get_for_qs(request.GET, qs) return qs + @login_required def labels_report_sem_presidente(request, id=None, formato='2x5_etiqueta'): """ TODO: adicionar suporte para resultado de pesquisa do admin. @@ -236,6 +243,7 @@ def labels_report_sem_presidente(request, id=None, formato='2x5_etiqueta'): return response + @login_required def report(request, id=None, tipo=None): @@ -261,6 +269,7 @@ def report(request, id=None, tipo=None): report.generate_by(PDFGenerator, filename=response) return response + @login_required def report_complete(request, id=None): @@ -271,33 +280,9 @@ def report_complete(request, id=None): if not qs: return HttpResponseRedirect('../') + + return render_to_pdf('casas/report_complete_pdf.html', {'casas': qs}) - response = HttpResponse(content_type='application/pdf') - response['Content-Disposition'] = 'attachment; filename=casas.pdf' - - # Gera um relatorio para cada casa e concatena os relatorios - cont = 0 - canvas = None - quant = qs.count() - if quant > 1: - for i in qs: - cont += 1 - # queryset deve ser uma lista - lista = (i,) - if cont == 1: - report = InfoCasaLegislativa(queryset=lista) - canvas = report.generate_by(PDFGenerator, return_canvas=True, filename=response,) - else: - report = InfoCasaLegislativa(queryset=lista) - if cont == quant: - report.generate_by(PDFGenerator, canvas=canvas) - else: - canvas = report.generate_by(PDFGenerator, canvas=canvas, return_canvas=True) - else: - report = InfoCasaLegislativa(queryset=qs) - report.generate_by(PDFGenerator, filename=response) - - return response @login_required def casas_sem_convenio_report(request): @@ -313,6 +298,7 @@ def casas_sem_convenio_report(request): report.generate_by(PDFGenerator, filename=response) return response + @login_required def export_csv(request): response = HttpResponse(content_type='text/csv') @@ -392,6 +378,7 @@ def export_csv(request): return response + @login_required def portfolio(request): page = request.GET.get('page', 1) @@ -426,7 +413,7 @@ def portfolio(request): data['mesorregioes'] = uf.mesorregiao_set.all() data['microrregioes'] = mesorregiao.microrregiao_set.all() data['form'] = PortfolioForm(_(u'Atribuir casas da microrregiao %s para') % (unicode(microrregiao),)) - data['querystring'] = 'micro=%s' % (microrregiao.pk,) + data['querystring'] = 'micro=%s' % (microrregiao.pk,) casas = CasaLegislativa.objects.filter(municipio__microrregiao=microrregiao) elif meso_id: mesorregiao = get_object_or_404(Mesorregiao, pk=meso_id) @@ -438,7 +425,7 @@ def portfolio(request): data['mesorregioes'] = uf.mesorregiao_set.all() data['microrregioes'] = mesorregiao.microrregiao_set.all() data['form'] = PortfolioForm(_(u'Atribuir casas da mesorregiao %s para') % (unicode(mesorregiao),)) - data['querystring'] = 'meso=%s' % (mesorregiao.pk,) + data['querystring'] = 'meso=%s' % (mesorregiao.pk,) casas = CasaLegislativa.objects.filter(municipio__microrregiao__mesorregiao=mesorregiao) elif uf_id: uf = get_object_or_404(UnidadeFederativa, pk=uf_id) @@ -447,13 +434,13 @@ def portfolio(request): data['ufs'] = UnidadeFederativa.objects.filter(regiao=uf.regiao) data['mesorregioes'] = uf.mesorregiao_set.all() data['form'] = PortfolioForm(_(u'Atribuir casas do estado %s para') % (unicode(uf),)) - data['querystring'] = 'uf=%s' % (uf.pk,) + data['querystring'] = 'uf=%s' % (uf.pk,) casas = CasaLegislativa.objects.filter(municipio__uf=uf) elif regiao: data['regiao'] = regiao data['ufs'] = UnidadeFederativa.objects.filter(regiao=regiao) - data['form'] = PortfolioForm(_(u'Atribuir casas da região %s para') % [x[1] for x in UnidadeFederativa.REGIAO_CHOICES if x[0]==regiao][0]) - data['querystring'] = 'regiao=%s' % (regiao,) + data['form'] = PortfolioForm(_(u'Atribuir casas da região %s para') % [x[1] for x in UnidadeFederativa.REGIAO_CHOICES if x[0] == regiao][0]) + data['querystring'] = 'regiao=%s' % (regiao,) casas = CasaLegislativa.objects.filter(municipio__uf__regiao=regiao) if casas: @@ -536,12 +523,12 @@ def resumo_carteira(casas): resumo.append([_(u"Casas em sua carteira"), total['total']] + [total[r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) resumo.append({'subtitle': _(u"Uso dos produtos Interlegis")}) resumo.append([_(u"Casas sem nenhum produto"), sem_produto['total']] + [sem_produto[r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) - resumo.extend([[ts.nome, dados[ts.id]['total']]+[dados[ts.id][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES] for ts in tipos_servico]) + resumo.extend([[ts.nome, dados[ts.id]['total']] + [dados[ts.id][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES] for ts in tipos_servico]) resumo.append({'subtitle': _(u"Registros no sistema de ocorrências")}) - resumo.append([_(u"Casas que nunca registraram ocorrências"), dados_ocorrencia['sem']['total']]+[dados_ocorrencia['sem'][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) - resumo.append([_(u"Total de ocorrências registradas"), dados_ocorrencia['registradas']['total']]+[dados_ocorrencia['registradas'][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) - resumo.append([_(u"Total de ocorrências pendentes"), dados_ocorrencia['pendentes']['total']]+[dados_ocorrencia['pendentes'][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) - resumo.append([_(u"Média de ocorrências por casa"), round(dados_ocorrencia['media']['total'],2)]+[round(dados_ocorrencia['media'][r[0]],2) for r in UnidadeFederativa.REGIAO_CHOICES]) + resumo.append([_(u"Casas que nunca registraram ocorrências"), dados_ocorrencia['sem']['total']] + [dados_ocorrencia['sem'][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) + resumo.append([_(u"Total de ocorrências registradas"), dados_ocorrencia['registradas']['total']] + [dados_ocorrencia['registradas'][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) + resumo.append([_(u"Total de ocorrências pendentes"), dados_ocorrencia['pendentes']['total']] + [dados_ocorrencia['pendentes'][r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) + resumo.append([_(u"Média de ocorrências por casa"), round(dados_ocorrencia['media']['total'], 2)] + [round(dados_ocorrencia['media'][r[0]], 2) for r in UnidadeFederativa.REGIAO_CHOICES]) return resumo @@ -594,7 +581,7 @@ def casas_carteira(request, casas, context): else: casas = casas.filter(servico__tipo_servico__sigla__in=servicos) casas = casas.distinct('nome', 'municipio__uf') - context['qs_servico'] = "&".join(['servico=%s' %s for s in servicos]) + context['qs_servico'] = "&".join(['servico=%s' % s for s in servicos]) context['servicos_check'] = servicos @@ -602,6 +589,7 @@ def casas_carteira(request, casas, context): return casas, context + @login_required def painel_relacionamento(request): page = request.GET.get('page', 1) @@ -634,7 +622,7 @@ def painel_relacionamento(request): 'servicos': tipos_servico, 'gerentes': Servidor.objects.exclude(casas_que_gerencia=None), 'gerente': gerente, - 'qs_servidor': ('servidor=%s' % gerente.pk) if gerente else '', + 'qs_servidor': ('servidor=%s' % gerente.pk) if gerente else '', } if snippet != 'lista': @@ -678,4 +666,4 @@ def painel_relacionamento(request): if snippet == 'resumo': return render(request, 'casas/resumo_carteira_snippet.html', context) - return render(request, 'casas/painel.html', context) \ No newline at end of file + return render(request, 'casas/painel.html', context) From 6f2a8f006bd3bfa0a261db87abbd46ece5c78381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 14 Jun 2019 15:18:17 -0300 Subject: [PATCH 07/69] =?UTF-8?q?Render=5Fto=5Fpdf=20encontrar=20imagens?= =?UTF-8?q?=20em=20STATIC=20ou=20MEDIA=20e=20for=C3=A7ar=20download?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/shortcuts.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sigi/shortcuts.py b/sigi/shortcuts.py index c70300a..f5f0fff 100644 --- a/sigi/shortcuts.py +++ b/sigi/shortcuts.py @@ -1,21 +1,31 @@ -import cStringIO as StringIO -import os +# -*- coding: utf-8 -*- from cgi import escape +import os -import ho.pisa as pisa from django.conf import settings from django.http import HttpResponse from django.template import Context from django.template.loader import get_template from django.utils.translation import ugettext as _ +import cStringIO as StringIO +import ho.pisa as pisa + def fetch_resources(uri, rel): - path = os.path.join(settings.MEDIA_ROOT, uri.replace(settings.MEDIA_URL, "")) + if uri.find(settings.STATIC_URL) != -1: + # Imagem está em STATIC_ROOT + path = os.path.join(settings.STATIC_ROOT, + uri.replace(settings.STATIC_URL, "")) + else: + # Imagem está em MEDIA_ROOT + path = os.path.join(settings.MEDIA_ROOT, + uri.replace(settings.MEDIA_URL, "")) return path def render_to_pdf(template_src, context_dict): + filename = template_src.replace('.html', '').replace('_pdf', '.pdf') template = get_template(template_src) context = Context(context_dict) html = template.render(context) @@ -23,5 +33,7 @@ def render_to_pdf(template_src, context_dict): pdf = pisa.pisaDocument(StringIO.StringIO(html.encode('utf-8')), result, link_callback=fetch_resources) if not pdf.err: - return HttpResponse(result.getvalue(), content_type='application/pdf') + response = HttpResponse(result.getvalue(), content_type='application/pdf') + response['Content-Disposition'] = 'attachment; filename=' + filename + return response return HttpResponse(_(u'We had some errors
%s
') % escape(html)) From 6bcb0ae5a96d888f5f9c0170c55ec24da39ce90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 14 Jun 2019 15:19:32 -0300 Subject: [PATCH 08/69] =?UTF-8?q?Usar=20pisa=20para=20mais=20alguns=20rela?= =?UTF-8?q?t=C3=B3rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/reports.py | 116 --------------- .../casas/templates/casas/report_pdf.html | 132 ++++++++++++++++++ sigi/apps/casas/views.py | 24 ++-- 3 files changed, 142 insertions(+), 130 deletions(-) create mode 100644 sigi/apps/casas/templates/casas/report_pdf.html diff --git a/sigi/apps/casas/reports.py b/sigi/apps/casas/reports.py index d94a3fa..e6e27c3 100644 --- a/sigi/apps/casas/reports.py +++ b/sigi/apps/casas/reports.py @@ -177,119 +177,3 @@ class CasasLegislativasLabelsSemPresidente(CasasLegislativasLabels): display_inline=True, default_style={'fontName': 'Helvetica', 'fontSize': self.tamanho_fonte}) - -class CasasLegislativasReport(ReportDefault): - title = _(u'Relatório de Casas Legislativas') - height = 80 * cm - page_size = landscape(A4) - - class band_page_header(ReportDefault.band_page_header): - - label_top = ReportDefault.band_page_header.label_top - label_left = [0.3, 1, 5.5, 11, 17, 22] - elements = list(ReportDefault.band_page_header.elements) - - elements = [ - Image(filename=static('img/logo-interlegis.jpg'), - left=23.5 * cm, right=1 * cm, top=0.1 * cm, bottom=1 * cm, - width=4.2 * cm, height=3 * cm, - ), - Image(filename=static('img/logo-senado.png'), - left=1 * cm, right=1 * cm, top=0.1 * cm, bottom=1 * cm, - width=3 * cm, height=3 * cm, - ), - Label(text=_(u"SENADO FEDERAL"), top=1 * cm, left=0, width=BAND_WIDTH, - style={'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER} - ), - Label(text=_(u"SINTER - Secretaria Especial do Interlegis"), top=1.5 * cm, left=0, width=BAND_WIDTH, - style={'fontName': 'Helvetica-Bold', 'fontSize': 13, 'alignment': TA_CENTER} - ), - SystemField( - expression='%(report_title)s', top=2.5 * cm, left=0, width=BAND_WIDTH, - style={'fontName': 'Helvetica-Bold', 'fontSize': 14, 'alignment': TA_CENTER} - ), - Label( - text=_(u"UF"), - left=label_left[0] * cm, - top=label_top, - ), - Label( - text=_(u"Municipio"), - left=label_left[1] * cm, - top=label_top, - ), - Label( - text=_(u"Presidente"), - left=label_left[2] * cm, - top=label_top, - ), - Label( - text=_(u"Endereço"), - left=label_left[3] * cm, - top=label_top, - ), - Label( - text=_(u"Endereço na Internet"), - left=label_left[4] * cm, - top=label_top, - ), - Label( - text=_(u"Email"), - left=label_left[5] * cm, - top=label_top, - ), - - ] - - class band_page_footer(ReportDefault.band_page_footer): - pass - - class band_detail(ReportDefault.band_detail): - - label_left = [0.3, 1, 5.5, 11, 17, 22] - - elements = [ - ObjectValue( - attribute_name='municipio.uf.sigla', - left=label_left[0] * cm, - width=1 * cm, - ), - ObjectValue( - attribute_name='municipio.nome', - left=label_left[1] * cm, - ), - ObjectValue( - attribute_name='presidente', - left=label_left[2] * cm, - ), - ObjectValue( - attribute_name='logradouro', - left=label_left[3] * cm, - get_value=lambda instance: instance.logradouro + ' - ' + instance.bairro, - ), - ObjectValue( - attribute_name='pagina_web', - left=label_left[4] * cm, - ), - ObjectValue( - attribute_name='email', - left=label_left[5] * cm, - ), - - ] - - groups = [ - ReportGroup(attribute_name='municipio.uf', - band_header=ReportBand( - height=0.7 * cm, - elements=[ - ObjectValue(attribute_name='municipio.uf') - ], - borders={'top': True}, - ) - ) - ] - - -class CasasSemConvenioReport(CasasLegislativasReport): - title = _(u'Relatório de Casas Legislativas sem Convênio') diff --git a/sigi/apps/casas/templates/casas/report_pdf.html b/sigi/apps/casas/templates/casas/report_pdf.html new file mode 100644 index 0000000..485e7de --- /dev/null +++ b/sigi/apps/casas/templates/casas/report_pdf.html @@ -0,0 +1,132 @@ +{% load smart_if %} +{% load static from staticfiles %} +{% load i18n %} + + + + + Casa Legislativa + + + + + + + + + + + + + + + + + + + + {% for casa in casas %} + {% ifchanged casa.municipio.uf %} + + {% endifchanged %} + + + + + + + + + + + {% endfor %} +
{% trans 'Casa' %}{% trans 'Presidente' %}{% trans 'Tipo' %}{% trans 'Endereço' %}{% trans 'Bairro' %}{% trans 'CEP' %}{% trans 'Telefone' %}{% trans 'E-mail' %}

{{ casa.municipio.uf.nome }}

{{ casa.nome }}{{ casa.presidente }}{{ casa.tipo.sigla }}{{ casa.logradouro }}{{ casa.bairro }}{{ casa.cep }}{{ casa.telefone }}{{ casa.email }}
+ + + + diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 97f5cdb..d760b85 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -13,9 +13,7 @@ from django.utils.translation import ugettext as _, ungettext from sigi.apps.casas.forms import PortfolioForm from sigi.apps.casas.models import CasaLegislativa from sigi.apps.casas.reports import (CasasLegislativasLabels, - CasasLegislativasLabelsSemPresidente, - CasasLegislativasReport, - CasasSemConvenioReport) + CasasLegislativasLabelsSemPresidente) from sigi.apps.contatos.models import UnidadeFederativa, Mesorregiao, Microrregiao from sigi.apps.ocorrencias.models import Ocorrencia from sigi.apps.parlamentares.reports import ParlamentaresLabels @@ -261,13 +259,11 @@ def report(request, id=None, tipo=None): if not qs: return HttpResponseRedirect('../') - - # qs.order_by('municipio__uf','nome') - response = HttpResponse(content_type='application/pdf') - response['Content-Disposition'] = 'attachment; filename=casas.pdf' - report = CasasLegislativasReport(queryset=qs) - report.generate_by(PDFGenerator, filename=response) - return response + + qs = qs.order_by('municipio__uf', 'nome') + context = {'casas': qs, 'title': _(u"Relação de Casas Legislativas")} + + return render_to_pdf('casas/report_pdf.html', context) @login_required @@ -293,10 +289,10 @@ def casas_sem_convenio_report(request): if not qs: return HttpResponseRedirect('../') - response = HttpResponse(content_type='application/pdf') - report = CasasSemConvenioReport(queryset=qs) - report.generate_by(PDFGenerator, filename=response) - return response + qs = qs.order_by('municipio__uf', 'nome') + context = {'casas': qs, 'title': _(u"Casas sem convênio")} + + return render_to_pdf('casas/report_pdf.html', context) @login_required From 5ae6322bf2fd5ee9321736d382fea98693bc2ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 7 Feb 2020 11:23:32 -0300 Subject: [PATCH 09/69] =?UTF-8?q?Aprimora=20filtro=20de=20convenios=20e=20?= =?UTF-8?q?adiciona=20filtro=20de=20servi=C3=A7os=20na=20listview=20das=20?= =?UTF-8?q?Casas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/admin.py | 107 ++++++++++++++++++++++++++++++++++++--- sigi/apps/casas/views.py | 56 ++++++++++++++++---- 2 files changed, 146 insertions(+), 17 deletions(-) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 392d752..7c998e0 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- -from django.core.urlresolvers import reverse + from django.contrib import admin from django.contrib.contenttypes import generic +from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect +from django.shortcuts import render from django.utils.translation import ugettext as _ from image_cropping import ImageCroppingMixin @@ -12,13 +14,13 @@ from sigi.apps.casas.views import report_complete, labels_report, export_csv, \ labels_report_sem_presidente, report, \ adicionar_casas_carrinho from sigi.apps.contatos.models import Telefone -from sigi.apps.convenios.models import Convenio +from sigi.apps.convenios.models import Convenio, Projeto from sigi.apps.diagnosticos.models import Diagnostico from sigi.apps.inventario.models import Bem from sigi.apps.metas.models import PlanoDiretor from sigi.apps.ocorrencias.models import Ocorrencia from sigi.apps.parlamentares.models import Legislatura -from sigi.apps.servicos.models import Servico +from sigi.apps.servicos.models import Servico, TipoServico from sigi.apps.servidores.models import Servidor from sigi.apps.utils import queryset_ascii from sigi.apps.utils.base_admin import BaseModelAdmin @@ -67,16 +69,19 @@ class ConveniosInline(admin.StackedInline): def get_tramitacoes(self, obj): return '
'.join([t.__unicode__() for t in obj.tramitacao_set.all()]) + get_tramitacoes.short_description = _(u'Tramitações') get_tramitacoes.allow_tags = True def get_anexos(self, obj): return '
'.join(['%s' % (a.arquivo.url, a.__unicode__()) for a in obj.anexo_set.all()]) + get_anexos.short_description = _(u'Anexos') get_anexos.allow_tags = True def get_equipamentos(self, obj): return '
'.join([e.__unicode__() for e in obj.equipamentoprevisto_set.all()]) + get_equipamentos.short_description = _(u'Equipamentos previstos') get_equipamentos.allow_tags = True @@ -173,6 +178,7 @@ class OcorrenciaInline(admin.TabularInline): link_editar.short_description = _(u'Editar') link_editar.allow_tags = True + class GerentesContasFilter(admin.filters.RelatedFieldListFilter): def __init__(self, *args, **kwargs): @@ -181,17 +187,76 @@ class GerentesContasFilter(admin.filters.RelatedFieldListFilter): self.lookup_choices = [(x.id, x) for x in gerentes] +class ConvenioFilter(admin.SimpleListFilter): + title = _(u"Tipo de convênio") + parameter_name = 'convenio' + + def lookups(self, request, model_admin): + return ( + ('SC', _(u"Sem nenhum convênio")), + ('CC', _(u"Com algum convênio")) + ) + tuple([(p.pk, p.sigla) for p in Projeto.objects.all()]) + + def queryset(self, request, queryset): + if self.value() is not None: + if self.value() == 'SC': + queryset = queryset.filter(convenio=None) + elif self.value() == 'CC': + queryset = queryset.exclude(convenio=None) + else: + queryset = queryset.filter(convenio__projeto_id=self.value()) + + return queryset.distinct('municipio__uf__nome', 'nome') + + +class ServicoFilter(admin.SimpleListFilter): + title = _(u"Serviço") + parameter_name = 'servico' + + def lookups(self, request, model_admin): + return ( + ('SS', _(u"Sem nenhum serviço")), + ('CS', _(u"Com algum serviço")), + ('CH', _(u"Com algum serviço de hospedagem")), + ('CR', _(u"Apenas serviço de registro")), + ) + tuple([(p.pk, p.nome) for p in TipoServico.objects.all()]) + + def queryset(self, request, queryset): + if self.value() is not None: + if self.value() == 'SS': + queryset = queryset.filter(servico=None) + elif self.value() == 'CS': + queryset = queryset.exclude(servico=None).filter( + servico__data_desativacao__isnull=True) + elif self.value() == 'CR': + queryset = queryset.exclude(servico__tipo_servico__modo='H') \ + .exclude(servico=None) + elif self.value() == 'CH': + queryset = queryset.filter( + servico__tipo_servico__modo='H', + servico__data_desativacao__isnull=True + ) + else: + queryset = queryset.filter( + servico__tipo_servico_id=self.value() + ) + + return queryset.distinct('municipio__uf__nome', 'nome') + + class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): form = CasaLegislativaForm actions = ['adicionar_casas', ] inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, ConveniosInline, LegislaturaInline, - DiagnosticoInline, BemInline, ServicoInline, PlanoDiretorInline, OcorrenciaInline, ) - list_display = ('nome', 'municipio', 'gerente_contas', 'get_convenios') + DiagnosticoInline, BemInline, ServicoInline, PlanoDiretorInline, OcorrenciaInline,) + list_display = ('nome', 'get_uf', 'get_gerente_contas', 'get_convenios', + 'get_servicos') list_display_links = ('nome',) - list_filter = ('tipo', ('gerente_contas', GerentesContasFilter), 'municipio__uf__nome', 'convenio__projeto', + list_filter = ('tipo', ('gerente_contas', GerentesContasFilter), + 'municipio__uf__nome', ConvenioFilter, ServicoFilter, 'inclusao_digital',) - ordering = ('nome', 'municipio__uf') - queyrset = queryset_ascii + ordering = ('municipio__uf__nome', 'nome') + queryset = queryset_ascii fieldsets = ( (None, { 'fields': ('tipo', 'nome', 'cnpj', 'num_parlamentares', 'gerente_contas') @@ -212,11 +277,31 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): search_fields = ('search_text', 'cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') + + def get_uf(self, obj): + return obj.municipio.uf.nome + get_uf.short_description = _(u'Unidade da Federação') + get_uf.admin_order_field = 'municipio__uf__nome' + + def get_gerente_contas(self, obj): + return obj.gerente_contas + + get_gerente_contas.short_description = _(u'Gerente de contas') + def get_convenios(self, obj): return '
    ' + ''.join(['
  • %s
  • ' % c.__unicode__() for c in obj.convenio_set.all()]) + '
' + get_convenios.short_description = _(u'Convênios') get_convenios.allow_tags = True + + def get_servicos(self, obj): + return '
    ' + ''.join(['
  • %s
  • ' % s.__unicode__() + for s in obj.servico_set.filter( + data_desativacao__isnull=True)]) + '
' + + get_servicos.short_description = _(u'Serviços') + get_servicos.allow_tags = True def changelist_view(self, request, extra_context=None): return super(CasaLegislativaAdmin, self).changelist_view( @@ -230,22 +315,27 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): def etiqueta(self, request, queryset): return labels_report(request, queryset=queryset) + etiqueta.short_description = _(u"Gerar etiqueta(s) da(s) casa(s) selecionada(s)") def etiqueta_sem_presidente(self, request, queryset): return labels_report_sem_presidente(request, queryset=queryset) + etiqueta_sem_presidente.short_description = _(u"Gerar etiqueta(s) sem presidente da(s) casa(s) selecionada(s)") def relatorio(self, request, queryset): return report(request, queryset=queryset) + relatorio.short_description = _(u"Exportar a(s) casa(s) selecionada(s) para PDF") def relatorio_completo(self, request, queryset): return report_complete(request, queryset=queryset) + relatorio_completo.short_description = _(u"Gerar relatório completo da(s) casa(s) selecionada(s)") def relatorio_csv(self, request, queryset): return export_csv(request) + relatorio_csv.short_description = _(u"Exportar casa(s) selecionada(s) para CSV") def adicionar_casas(self, request, queryset): @@ -271,5 +361,6 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): del actions['delete_selected'] return actions + admin.site.register(CasaLegislativa, CasaLegislativaAdmin) admin.site.register(TipoCasaLegislativa) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index d760b85..9eb7119 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -49,7 +49,39 @@ def get_for_qs(get, qs): for k, v in get.iteritems(): if str(k) not in ('page', 'pop', 'q', '_popup', 'o', 'ot'): kwargs[str(k)] = v + + if 'convenio' in kwargs: + if kwargs['convenio'] == 'SC': + qs = qs.filter(convenio=None) + elif kwargs['convenio'] == 'CC': + qs = qs.exclude(convenio=None) + else: + qs = qs.filter(convenio__projeto_id=kwargs['convenio']) + + qs = qs.distinct('municipio__uf__nome', 'nome') + del(kwargs['convenio']) + + if 'servico' in kwargs: + if kwargs['servico'] == 'SS': + qs = qs.filter(servico=None) + elif kwargs['servico'] == 'CS': + qs = qs.exclude(servico=None).filter( + servico__data_desativacao__isnull=True) + elif kwargs['servico'] == 'CR': + qs = qs.exclude(servico__tipo_servico__modo='H') \ + .exclude(servico=None) + elif kwargs['servico'] == 'CH': + qs = qs.filter( + servico__tipo_servico__modo='H', + servico__data_desativacao__isnull=True + ) + else: + qs = qs.filter(servico__tipo_servico_id=kwargs['servico']) + qs = qs.distinct('municipio__uf__nome', 'nome') + + del(kwargs['servico']) + qs = qs.filter(**kwargs) if 'o' in get: qs = query_ordena(qs, get['o']) @@ -307,18 +339,19 @@ def export_csv(request): return HttpResponseRedirect('../') atributos = request.POST.getlist("itens_csv_selected") - atributos2 = [s.encode("utf-8") for s in atributos] try: - atributos2.insert(atributos2.index(_(u'Município')), _(u'UF')) + atributos.insert(atributos.index(_(u'Município')), _(u'UF')) except ValueError: pass + atributos2 = [s.encode("utf-8") for s in atributos] + writer.writerow(atributos2) for casa in casas: lista = [] - contatos = casa.funcionario_set.filter(setor="contato_interlegis") + contatos = casa.funcionario_set.exclude(nome="") for atributo in atributos: if _(u"CNPJ") == atributo: lista.append(casa.cnpj.encode("utf-8")) @@ -353,18 +386,23 @@ def export_csv(request): elif _(u"Última alteração de endereco") == atributo: lista.append(casa.ult_alt_endereco) elif _(u"Nome contato") == atributo: - if contatos and contatos[0].nome: - lista.append(contatos[0].nome.encode("utf-8")) + if contatos: + nomes = u", ".join([c.nome for c in contatos]) + lista.append(nomes.encode("utf-8")) else: lista.append('') elif _(u"Cargo contato") == atributo: - if contatos and contatos[0].cargo: - lista.append(contatos[0].cargo.encode("utf-8")) + if contatos: + cargos = u", ".join([c.cargo if c.cargo else u"?" + for c in contatos]) + lista.append(cargos.encode("utf-8")) else: lista.append('') elif _(u"Email contato") == atributo: - if contatos and contatos[0].email: - lista.append(contatos[0].email.encode("utf-8")) + if contatos: + emails = u", ".join([c.email if c.email else u"?" + for c in contatos]) + lista.append(emails.encode("utf-8")) else: lista.append('') else: From 380d9e45deb2b5459d17351c01836cdfb7305f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 7 Feb 2020 13:45:16 -0300 Subject: [PATCH 10/69] Adiciona campos em Casas e Contatos da Casa --- sigi/apps/casas/admin.py | 18 ++++++++++--- .../migrations/0003_auto_20200207_0919.py | 26 +++++++++++++++++++ sigi/apps/casas/models.py | 11 ++++++-- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 sigi/apps/casas/migrations/0003_auto_20200207_0919.py diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 7c998e0..e84c73e 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -34,7 +34,14 @@ class TelefonesInline(generic.GenericTabularInline): class PresidenteInline(admin.StackedInline): model = Presidente - exclude = ['cargo', 'funcao'] + fieldsets = ((None, { + 'fields': ( + ('nome', 'sexo', 'data_nascimento'), + ('nota', 'email', 'tempo_de_servico'), + ('ult_alteracao',), + ) + }),) +# exclude = ['setor', 'cargo', 'funcao'] readonly_fields = ('ult_alteracao',) extra = 1 max_num = 1 @@ -44,7 +51,12 @@ class PresidenteInline(admin.StackedInline): class FuncionariosInline(admin.StackedInline): model = Funcionario fieldsets = ((None, { - 'fields': (('nome', 'sexo', 'nota', 'email'), ('cargo', 'funcao', 'setor', 'tempo_de_servico'), 'ult_alteracao') + 'fields': ( + ('nome', 'sexo', 'data_nascimento'), + ('nota', 'email'), + ('cargo', 'funcao', 'setor'), + ('tempo_de_servico', 'ult_alteracao'), + ) }),) readonly_fields = ('ult_alteracao',) extra = 1 @@ -269,7 +281,7 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): 'fields': ('inclusao_digital', 'data_levantamento', 'pesquisador', 'pagina_web', 'email', 'obs_pesquisa',) }), (_(u'Outras informações'), { - 'fields': ('observacoes', 'foto', 'recorte'), + 'fields': ('observacoes', 'horario_funcionamento', 'foto', 'recorte'), }), ) raw_id_fields = ('municipio',) diff --git a/sigi/apps/casas/migrations/0003_auto_20200207_0919.py b/sigi/apps/casas/migrations/0003_auto_20200207_0919.py new file mode 100644 index 0000000..ffc534f --- /dev/null +++ b/sigi/apps/casas/migrations/0003_auto_20200207_0919.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0002_auto_20150710_1247'), + ] + + operations = [ + migrations.AddField( + model_name='casalegislativa', + name='horario_funcionamento', + field=models.CharField(max_length=100, verbose_name='Hor\xe1rio de funcionamento da Casa Legislativa', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='funcionario', + name='data_nascimento', + field=models.DateField(null=True, verbose_name='Data de nascimento', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index b199579..38f2138 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- +from datetime import datetime import random from string import ascii_uppercase from unicodedata import normalize -from datetime import datetime from django.contrib.contenttypes import generic from django.db import models from image_cropping import ImageRatioField @@ -54,6 +54,11 @@ class CasaLegislativa(models.Model): tipo = models.ForeignKey(TipoCasaLegislativa, verbose_name="Tipo") cnpj = models.CharField('CNPJ', max_length=32, blank=True) observacoes = models.TextField(u'observações', blank=True) + horario_funcionamento = models.CharField( + u"Horário de funcionamento da Casa Legislativa", + max_length=100, + blank=True, + ) # num_parlamentares = models.PositiveIntegerField('Número de parlamentares') codigo_interlegis = models.CharField('Código Interlegis', max_length=3, blank=True) # codigo_interlegis.ts_filter = True @@ -93,7 +98,7 @@ class CasaLegislativa(models.Model): height_field='foto_altura', blank=True ) - recorte = ImageRatioField('foto', '400x300', verbose_name="Recorte", ) + recorte = ImageRatioField('foto', '400x300', verbose_name="Recorte",) foto_largura = models.SmallIntegerField(editable=False, null=True) foto_altura = models.SmallIntegerField(editable=False, null=True) data_instalacao = models.DateField(u'Data de instalação da Casa Legislativa', null=True, blank=True) @@ -291,6 +296,8 @@ class Funcionario(models.Model): nome = models.CharField('nome completo', max_length=60, blank=False) # nome.alphabetic_filter = True sexo = models.CharField(max_length=1, choices=SEXO_CHOICES, default="M") + data_nascimento = models.DateField(u"Data de nascimento", blank=True, + null=True) nota = models.CharField(max_length=70, null=True, blank=True) email = models.CharField('e-mail', max_length=75, blank=True) telefones = generic.GenericRelation('contatos.Telefone') From c961a1fc0d14f310849e3aebacada40cf0fae803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 6 Aug 2020 12:43:41 -0300 Subject: [PATCH 11/69] =?UTF-8?q?Adiciona=20lista=20de=20servi=C3=A7os=20n?= =?UTF-8?q?a=20exporta=C3=A7=C3=A3o=20de=20Casas=20para=20CSV?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/templates/casas/carrinho.html | 6 ++++++ sigi/apps/casas/views.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/sigi/apps/casas/templates/casas/carrinho.html b/sigi/apps/casas/templates/casas/carrinho.html index d0cd27b..e8796a6 100644 --- a/sigi/apps/casas/templates/casas/carrinho.html +++ b/sigi/apps/casas/templates/casas/carrinho.html @@ -186,6 +186,12 @@ value="Última alteração de endereco" class="action-select" checked="checked" /> +
  • + + + +
  • diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 9eb7119..eb74f54 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -385,6 +385,11 @@ def export_csv(request): lista.append(casa.total_parlamentares) elif _(u"Última alteração de endereco") == atributo: lista.append(casa.ult_alt_endereco) + elif _(u"Servicos SEIT") == atributo: + lista.append(", ".join([s.tipo_servico.nome.encode('utf-8') + for s in casa.servico_set.filter( + data_desativacao__isnull=True)]) + ) elif _(u"Nome contato") == atributo: if contatos: nomes = u", ".join([c.nome for c in contatos]) From 9db266f0ad649c3a3023159fd1e063880dd14120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 29 Oct 2020 12:04:41 -0300 Subject: [PATCH 12/69] Remodelagem para Gerentes Interlegis e outras --- scripts/setgerentes/dados_gerentes.py | 5592 ----------------- scripts/setgerentes/set_gerentes.py | 16 - sigi/apps/casas/admin.py | 127 +- sigi/apps/casas/forms.py | 20 +- .../management/commands/importa_gerentes.py | 34 +- .../migrations/0004_auto_20201015_0810.py | 20 + ...005_casalegislativa_gerentes_interlegis.py | 21 + ...6_remove_casalegislativa_gerente_contas.py | 18 + .../migrations/0007_auto_20201016_1632.py | 128 + sigi/apps/casas/models.py | 205 +- .../apps/casas/templates/casas/portfolio.html | 46 +- sigi/apps/casas/test_casas.py | 2 +- sigi/apps/casas/views.py | 111 +- sigi/apps/convenios/admin.py | 2 +- .../migrations/0002_convenio_duracao.py | 20 + sigi/apps/convenios/models.py | 71 +- .../home/templates/home/sem_convenio.html | 2 +- sigi/apps/home/views.py | 49 +- sigi/apps/metas/views.py | 103 +- sigi/apps/ocorrencias/admin.py | 17 +- sigi/apps/ocorrencias/filters.py | 4 +- .../ocorrencias/ocorrencia_snippet.html | 10 +- sigi/apps/ocorrencias/views.py | 73 +- 23 files changed, 828 insertions(+), 5863 deletions(-) delete mode 100644 scripts/setgerentes/dados_gerentes.py delete mode 100644 scripts/setgerentes/set_gerentes.py create mode 100644 sigi/apps/casas/migrations/0004_auto_20201015_0810.py create mode 100644 sigi/apps/casas/migrations/0005_casalegislativa_gerentes_interlegis.py create mode 100644 sigi/apps/casas/migrations/0006_remove_casalegislativa_gerente_contas.py create mode 100644 sigi/apps/casas/migrations/0007_auto_20201016_1632.py create mode 100644 sigi/apps/convenios/migrations/0002_convenio_duracao.py diff --git a/scripts/setgerentes/dados_gerentes.py b/scripts/setgerentes/dados_gerentes.py deleted file mode 100644 index 2000914..0000000 --- a/scripts/setgerentes/dados_gerentes.py +++ /dev/null @@ -1,5592 +0,0 @@ -# -*- coding: utf-8 -*- -from sigi.apps.servidores.models import Servidor - - -gerentes = {k: Servidor.objects.get(nome_completo=n) for k, n in ( - ('ADAL', u'Adalberto Alves de Oliveira'), - ('janarycn', u'Janary Carvão Nunes'), - ('JBGOIS', u'José Bonifácio de Góis Júnior'), - ('LFERNAN', u'Luis Fernando Pires Machado'), - ('LILIANE', u'Liliane Silva'), - ('MARGARET', u'Margarete Gomes de Oliveira Silva'), - ('OTTO', u'Otto Luiz Vilela do Nascimento'), - ('PATI', u'Patricia Boureau Alvares da Silva'), - ('pillarap', u'Pillar Alexandre Pedreira'), - ('RAFAHLS', u'Rafael Henrique Leite e Souza'), - ('robsoner', u'Robson Aurélio Neri'), - ('BLUZ', u'Rodrigo Barbosa da Luz'), - ('RONALDL', u'Ronaldo Luiz Leite Oliveira'), - ('TELMAV', u'Telma América Venturelli'), -)} - -atrib = [ - (1100015, 'RAFAHLS'), - (1100379, 'RAFAHLS'), - (1100403, 'RAFAHLS'), - (1100346, 'RAFAHLS'), - (1100023, 'RAFAHLS'), - (1100452, 'robsoner'), - (1100031, 'RAFAHLS'), - (1100601, 'RAFAHLS'), - (1100049, 'RAFAHLS'), - (1100700, 'robsoner'), - (1100809, 'robsoner'), - (1100908, 'RAFAHLS'), - (1100056, 'RAFAHLS'), - (1100924, 'RAFAHLS'), - (1100064, 'RAFAHLS'), - (1100072, 'RAFAHLS'), - (1100080, 'robsoner'), - (1100940, 'robsoner'), - (1100098, 'RAFAHLS'), - (1101005, 'RAFAHLS'), - (1100106, 'robsoner'), - (1101104, 'robsoner'), - (1100114, 'RAFAHLS'), - (1100122, 'RAFAHLS'), - (1100130, 'RAFAHLS'), - (1101203, 'RAFAHLS'), - (1101302, 'RAFAHLS'), - (1101401, 'RAFAHLS'), - (1100148, 'RAFAHLS'), - (1100338, 'robsoner'), - (1101435, 'RAFAHLS'), - (1100502, 'RAFAHLS'), - (1100155, 'RAFAHLS'), - (1101450, 'RAFAHLS'), - (1100189, 'RAFAHLS'), - (1101468, 'RAFAHLS'), - (1100205, 'robsoner'), - (1100254, 'RAFAHLS'), - (1101476, 'RAFAHLS'), - (1100262, 'RAFAHLS'), - (1100288, 'RAFAHLS'), - (1100296, 'RAFAHLS'), - (1101484, 'RAFAHLS'), - (1101492, 'robsoner'), - (1100320, 'RAFAHLS'), - (1101500, 'RAFAHLS'), - (1101559, 'RAFAHLS'), - (1101609, 'RAFAHLS'), - (1101708, 'RAFAHLS'), - (1101757, 'RAFAHLS'), - (1101807, 'RAFAHLS'), - (1100304, 'RAFAHLS'), - (1200203, 'robsoner'), - (1200336, 'robsoner'), - (1200351, 'robsoner'), - (1200393, 'robsoner'), - (1200427, 'robsoner'), - (1200302, 'robsoner'), - (1200328, 'robsoner'), - (1200609, 'robsoner'), - (1200344, 'MARGARET'), - (1200435, 'MARGARET'), - (1200500, 'MARGARET'), - (1200013, 'MARGARET'), - (1200138, 'MARGARET'), - (1200179, 'MARGARET'), - (1200385, 'MARGARET'), - (1200401, 'MARGARET'), - (1200450, 'MARGARET'), - (1200807, 'MARGARET'), - (1200054, 'MARGARET'), - (1200104, 'MARGARET'), - (1200252, 'MARGARET'), - (1200708, 'MARGARET'), - (1300409, 'PATI'), - (1303205, 'PATI'), - (1303601, 'PATI'), - (1303809, 'PATI'), - (1302108, 'PATI'), - (1302801, 'PATI'), - (1300060, 'JBGOIS'), - (1300201, 'JBGOIS'), - (1300607, 'JBGOIS'), - (1301605, 'JBGOIS'), - (1302306, 'JBGOIS'), - (1303700, 'JBGOIS'), - (1303908, 'JBGOIS'), - (1304062, 'JBGOIS'), - (1304237, 'JBGOIS'), - (1301001, 'JBGOIS'), - (1301407, 'JBGOIS'), - (1301506, 'JBGOIS'), - (1301654, 'JBGOIS'), - (1301803, 'JBGOIS'), - (1301951, 'JBGOIS'), - (1302207, 'JBGOIS'), - (1300029, 'LILIANE'), - (1304203, 'LILIANE'), - (1304260, 'LILIANE'), - (1300086, 'LILIANE'), - (1300102, 'LILIANE'), - (1300631, 'LILIANE'), - (1300839, 'LILIANE'), - (1301209, 'LILIANE'), - (1301308, 'LILIANE'), - (1300300, 'LILIANE'), - (1301100, 'LILIANE'), - (1301159, 'LILIANE'), - (1301852, 'LILIANE'), - (1302504, 'LILIANE'), - (1302553, 'LILIANE'), - (1302603, 'LILIANE'), - (1303536, 'LILIANE'), - (1303569, 'LILIANE'), - (1301902, 'LILIANE'), - (1302009, 'LILIANE'), - (1303106, 'LILIANE'), - (1304005, 'LILIANE'), - (1304401, 'LILIANE'), - (1300508, 'LILIANE'), - (1300680, 'LILIANE'), - (1302900, 'LILIANE'), - (1303007, 'LILIANE'), - (1303403, 'LILIANE'), - (1303957, 'LILIANE'), - (1304302, 'LILIANE'), - (1300706, 'PATI'), - (1303502, 'PATI'), - (1300904, 'PATI'), - (1302405, 'PATI'), - (1304104, 'PATI'), - (1300144, 'PATI'), - (1300805, 'PATI'), - (1301704, 'PATI'), - (1302702, 'PATI'), - (1303304, 'PATI'), - (1400050, 'ADAL'), - (1400027, 'ADAL'), - (1400100, 'ADAL'), - (1400159, 'ADAL'), - (1400175, 'ADAL'), - (1400209, 'RONALDL'), - (1400233, 'RONALDL'), - (1400282, 'RONALDL'), - (1400308, 'RONALDL'), - (1400407, 'ADAL'), - (1400456, 'ADAL'), - (1400472, 'RONALDL'), - (1400506, 'RONALDL'), - (1400605, 'RONALDL'), - (1400704, 'ADAL'), - (1500107, 'LFERNAN'), - (1500131, 'RONALDL'), - (1500206, 'LFERNAN'), - (1500305, 'pillarap'), - (1500347, 'RONALDL'), - (1500404, 'janarycn'), - (1500503, 'janarycn'), - (1500602, 'OTTO'), - (1500701, 'pillarap'), - (1500800, 'robsoner'), - (1500859, 'OTTO'), - (1500909, 'LFERNAN'), - (1500958, 'LFERNAN'), - (1501006, 'OTTO'), - (1501105, 'pillarap'), - (1501204, 'LFERNAN'), - (1501253, 'RONALDL'), - (1501303, 'robsoner'), - (1501402, 'robsoner'), - (1501451, 'janarycn'), - (1501501, 'robsoner'), - (1501576, 'RONALDL'), - (1501600, 'LFERNAN'), - (1501709, 'LFERNAN'), - (1501725, 'OTTO'), - (1501758, 'RONALDL'), - (1501782, 'RONALDL'), - (1501808, 'pillarap'), - (1501907, 'robsoner'), - (1502004, 'pillarap'), - (1501956, 'LFERNAN'), - (1502103, 'LFERNAN'), - (1502152, 'RONALDL'), - (1502202, 'LFERNAN'), - (1502301, 'LFERNAN'), - (1502400, 'robsoner'), - (1502509, 'pillarap'), - (1502608, 'LFERNAN'), - (1502707, 'RONALDL'), - (1502756, 'LFERNAN'), - (1502764, 'RONALDL'), - (1502772, 'RONALDL'), - (1502806, 'pillarap'), - (1502855, 'janarycn'), - (1502905, 'LFERNAN'), - (1502939, 'RONALDL'), - (1502954, 'RONALDL'), - (1503002, 'janarycn'), - (1503044, 'RONALDL'), - (1503077, 'LFERNAN'), - (1503093, 'RONALDL'), - (1503101, 'pillarap'), - (1503200, 'LFERNAN'), - (1503309, 'LFERNAN'), - (1503408, 'robsoner'), - (1503457, 'LFERNAN'), - (1503507, 'LFERNAN'), - (1503606, 'OTTO'), - (1503705, 'RONALDL'), - (1503754, 'OTTO'), - (1503804, 'RONALDL'), - (1503903, 'janarycn'), - (1504000, 'LFERNAN'), - (1504059, 'LFERNAN'), - (1504109, 'LFERNAN'), - (1504208, 'RONALDL'), - (1504307, 'LFERNAN'), - (1504406, 'LFERNAN'), - (1504422, 'robsoner'), - (1504455, 'OTTO'), - (1504505, 'pillarap'), - (1504604, 'LFERNAN'), - (1504703, 'LFERNAN'), - (1504752, 'janarycn'), - (1504802, 'janarycn'), - (1504901, 'pillarap'), - (1504950, 'LFERNAN'), - (1504976, 'RONALDL'), - (1505007, 'LFERNAN'), - (1505031, 'OTTO'), - (1505064, 'RONALDL'), - (1505106, 'janarycn'), - (1505205, 'LFERNAN'), - (1505304, 'janarycn'), - (1505403, 'LFERNAN'), - (1505437, 'RONALDL'), - (1505486, 'OTTO'), - (1505494, 'RONALDL'), - (1505502, 'RONALDL'), - (1505536, 'RONALDL'), - (1505551, 'RONALDL'), - (1505601, 'LFERNAN'), - (1505635, 'RONALDL'), - (1505650, 'janarycn'), - (1505700, 'pillarap'), - (1505809, 'pillarap'), - (1505908, 'janarycn'), - (1506005, 'janarycn'), - (1506104, 'LFERNAN'), - (1506112, 'LFERNAN'), - (1506138, 'RONALDL'), - (1506161, 'RONALDL'), - (1506187, 'RONALDL'), - (1506195, 'OTTO'), - (1506203, 'LFERNAN'), - (1506302, 'pillarap'), - (1506351, 'robsoner'), - (1506401, 'pillarap'), - (1506500, 'robsoner'), - (1506559, 'LFERNAN'), - (1506583, 'RONALDL'), - (1506609, 'LFERNAN'), - (1506708, 'RONALDL'), - (1506807, 'janarycn'), - (1506906, 'LFERNAN'), - (1507003, 'robsoner'), - (1507102, 'LFERNAN'), - (1507151, 'RONALDL'), - (1507201, 'LFERNAN'), - (1507300, 'RONALDL'), - (1507409, 'LFERNAN'), - (1507458, 'RONALDL'), - (1507466, 'LFERNAN'), - (1507474, 'LFERNAN'), - (1507508, 'RONALDL'), - (1507607, 'LFERNAN'), - (1507706, 'pillarap'), - (1507755, 'RONALDL'), - (1507805, 'OTTO'), - (1507904, 'pillarap'), - (1507953, 'LFERNAN'), - (1507961, 'LFERNAN'), - (1507979, 'janarycn'), - (1508001, 'LFERNAN'), - (1508035, 'LFERNAN'), - (1508050, 'OTTO'), - (1508084, 'RONALDL'), - (1508100, 'RONALDL'), - (1508126, 'RONALDL'), - (1508159, 'OTTO'), - (1508209, 'LFERNAN'), - (1508308, 'LFERNAN'), - (1508357, 'OTTO'), - (1508407, 'RONALDL'), - (1600204, 'JBGOIS'), - (1600501, 'JBGOIS'), - (1600105, 'JBGOIS'), - (1600550, 'JBGOIS'), - (1600709, 'JBGOIS'), - (1600055, 'janarycn'), - (1600154, 'janarycn'), - (1600212, 'janarycn'), - (1600238, 'janarycn'), - (1600253, 'janarycn'), - (1600303, 'janarycn'), - (1600535, 'janarycn'), - (1600600, 'janarycn'), - (1600279, 'janarycn'), - (1600402, 'janarycn'), - (1600808, 'janarycn'), - (1700251, 'TELMAV'), - (1700301, 'TELMAV'), - (1700350, 'TELMAV'), - (1700400, 'BLUZ'), - (1700707, 'TELMAV'), - (1701002, 'TELMAV'), - (1701051, 'TELMAV'), - (1701101, 'BLUZ'), - (1701309, 'TELMAV'), - (1701903, 'TELMAV'), - (1702000, 'TELMAV'), - (1702109, 'TELMAV'), - (1702158, 'TELMAV'), - (1702208, 'TELMAV'), - (1702307, 'TELMAV'), - (1702406, 'BLUZ'), - (1702554, 'TELMAV'), - (1702703, 'BLUZ'), - (1702901, 'TELMAV'), - (1703008, 'TELMAV'), - (1703057, 'TELMAV'), - (1703073, 'BLUZ'), - (1703107, 'TELMAV'), - (1703206, 'TELMAV'), - (1703305, 'BLUZ'), - (1703602, 'TELMAV'), - (1703701, 'TELMAV'), - (1703800, 'TELMAV'), - (1703826, 'TELMAV'), - (1703842, 'BLUZ'), - (1703867, 'TELMAV'), - (1703883, 'TELMAV'), - (1703891, 'TELMAV'), - (1703909, 'TELMAV'), - (1704105, 'BLUZ'), - (1705102, 'BLUZ'), - (1704600, 'TELMAV'), - (1705508, 'TELMAV'), - (1716703, 'TELMAV'), - (1705557, 'BLUZ'), - (1705607, 'BLUZ'), - (1706001, 'TELMAV'), - (1706100, 'TELMAV'), - (1706258, 'TELMAV'), - (1706506, 'TELMAV'), - (1707009, 'BLUZ'), - (1707108, 'TELMAV'), - (1707207, 'TELMAV'), - (1707306, 'TELMAV'), - (1707405, 'TELMAV'), - (1707553, 'TELMAV'), - (1707652, 'TELMAV'), - (1707702, 'TELMAV'), - (1708205, 'TELMAV'), - (1708254, 'TELMAV'), - (1708304, 'TELMAV'), - (1709005, 'BLUZ'), - (1709302, 'TELMAV'), - (1709500, 'TELMAV'), - (1709807, 'BLUZ'), - (1710508, 'BLUZ'), - (1710706, 'TELMAV'), - (1710904, 'BLUZ'), - (1711100, 'TELMAV'), - (1711506, 'TELMAV'), - (1711803, 'TELMAV'), - (1711902, 'TELMAV'), - (1711951, 'BLUZ'), - (1712009, 'BLUZ'), - (1712157, 'BLUZ'), - (1712405, 'BLUZ'), - (1712454, 'TELMAV'), - (1712504, 'TELMAV'), - (1712702, 'BLUZ'), - (1712801, 'TELMAV'), - (1713205, 'TELMAV'), - (1713304, 'TELMAV'), - (1713601, 'BLUZ'), - (1713700, 'TELMAV'), - (1713957, 'TELMAV'), - (1714203, 'BLUZ'), - (1714302, 'TELMAV'), - (1714880, 'TELMAV'), - (1715002, 'TELMAV'), - (1715101, 'BLUZ'), - (1715150, 'BLUZ'), - (1715259, 'BLUZ'), - (1715507, 'TELMAV'), - (1721000, 'BLUZ'), - (1715705, 'TELMAV'), - (1713809, 'TELMAV'), - (1715754, 'TELMAV'), - (1716109, 'TELMAV'), - (1716208, 'BLUZ'), - (1716307, 'TELMAV'), - (1716505, 'BLUZ'), - (1716604, 'TELMAV'), - (1716653, 'TELMAV'), - (1717008, 'BLUZ'), - (1717206, 'TELMAV'), - (1717503, 'TELMAV'), - (1717800, 'BLUZ'), - (1717909, 'BLUZ'), - (1718006, 'BLUZ'), - (1718204, 'BLUZ'), - (1718303, 'TELMAV'), - (1718402, 'TELMAV'), - (1718451, 'TELMAV'), - (1718501, 'BLUZ'), - (1718550, 'TELMAV'), - (1718659, 'BLUZ'), - (1718709, 'TELMAV'), - (1718758, 'BLUZ'), - (1718808, 'TELMAV'), - (1718840, 'TELMAV'), - (1718865, 'TELMAV'), - (1718881, 'BLUZ'), - (1718899, 'TELMAV'), - (1718907, 'BLUZ'), - (1719004, 'BLUZ'), - (1720002, 'TELMAV'), - (1720101, 'TELMAV'), - (1720150, 'BLUZ'), - (1720200, 'TELMAV'), - (1720259, 'TELMAV'), - (1720309, 'TELMAV'), - (1720499, 'BLUZ'), - (1720655, 'BLUZ'), - (1720804, 'TELMAV'), - (1720853, 'TELMAV'), - (1720903, 'BLUZ'), - (1720937, 'BLUZ'), - (1720978, 'TELMAV'), - (1721109, 'BLUZ'), - (1721208, 'TELMAV'), - (1721257, 'TELMAV'), - (1721307, 'TELMAV'), - (1722081, 'TELMAV'), - (1722107, 'TELMAV'), - (2100055, 'LILIANE'), - (2100105, 'PATI'), - (2100154, 'PATI'), - (2100204, 'LILIANE'), - (2100303, 'PATI'), - (2100402, 'LILIANE'), - (2100436, 'PATI'), - (2100477, 'LILIANE'), - (2100501, 'JBGOIS'), - (2100550, 'LILIANE'), - (2100600, 'LILIANE'), - (2100709, 'LILIANE'), - (2100808, 'PATI'), - (2100832, 'LILIANE'), - (2100873, 'LILIANE'), - (2100907, 'PATI'), - (2100956, 'JBGOIS'), - (2101004, 'LILIANE'), - (2101103, 'LILIANE'), - (2101202, 'JBGOIS'), - (2101251, 'LILIANE'), - (2101301, 'LILIANE'), - (2101350, 'LILIANE'), - (2101400, 'JBGOIS'), - (2101509, 'PATI'), - (2101608, 'JBGOIS'), - (2101707, 'LILIANE'), - (2101772, 'LILIANE'), - (2101731, 'PATI'), - (2101806, 'JBGOIS'), - (2101905, 'LILIANE'), - (2101939, 'JBGOIS'), - (2101970, 'LILIANE'), - (2102002, 'LILIANE'), - (2102036, 'LILIANE'), - (2102077, 'JBGOIS'), - (2102101, 'PATI'), - (2102150, 'LILIANE'), - (2102200, 'PATI'), - (2102309, 'PATI'), - (2102325, 'LILIANE'), - (2102358, 'LILIANE'), - (2102374, 'LILIANE'), - (2102408, 'LILIANE'), - (2102507, 'LILIANE'), - (2102556, 'JBGOIS'), - (2102606, 'LILIANE'), - (2102705, 'LILIANE'), - (2102754, 'PATI'), - (2102804, 'JBGOIS'), - (2102903, 'LILIANE'), - (2103000, 'PATI'), - (2103109, 'LILIANE'), - (2103125, 'LILIANE'), - (2103158, 'LILIANE'), - (2103174, 'LILIANE'), - (2103208, 'PATI'), - (2103257, 'LILIANE'), - (2103307, 'PATI'), - (2103406, 'PATI'), - (2103505, 'PATI'), - (2103554, 'LILIANE'), - (2103604, 'PATI'), - (2103703, 'LILIANE'), - (2103752, 'LILIANE'), - (2103802, 'JBGOIS'), - (2103901, 'PATI'), - (2104008, 'JBGOIS'), - (2104057, 'JBGOIS'), - (2104073, 'JBGOIS'), - (2104081, 'JBGOIS'), - (2104099, 'JBGOIS'), - (2104107, 'JBGOIS'), - (2104206, 'JBGOIS'), - (2104305, 'LILIANE'), - (2104404, 'JBGOIS'), - (2104503, 'JBGOIS'), - (2104552, 'LILIANE'), - (2104602, 'JBGOIS'), - (2104628, 'JBGOIS'), - (2104651, 'LILIANE'), - (2104677, 'LILIANE'), - (2104701, 'JBGOIS'), - (2104800, 'JBGOIS'), - (2104909, 'LILIANE'), - (2105005, 'LILIANE'), - (2105104, 'LILIANE'), - (2105153, 'LILIANE'), - (2105203, 'JBGOIS'), - (2105302, 'LILIANE'), - (2105351, 'JBGOIS'), - (2105401, 'LILIANE'), - (2105427, 'LILIANE'), - (2105450, 'PATI'), - (2105476, 'JBGOIS'), - (2105500, 'LILIANE'), - (2105609, 'JBGOIS'), - (2105658, 'LILIANE'), - (2105708, 'LILIANE'), - (2105807, 'JBGOIS'), - (2105948, 'JBGOIS'), - (2105906, 'JBGOIS'), - (2105922, 'PATI'), - (2105963, 'LILIANE'), - (2105989, 'LILIANE'), - (2106003, 'JBGOIS'), - (2106102, 'JBGOIS'), - (2106201, 'LILIANE'), - (2106300, 'PATI'), - (2106326, 'LILIANE'), - (2106359, 'LILIANE'), - (2106375, 'LILIANE'), - (2106409, 'PATI'), - (2106508, 'LILIANE'), - (2106607, 'PATI'), - (2106631, 'LILIANE'), - (2106672, 'PATI'), - (2106706, 'PATI'), - (2106755, 'LILIANE'), - (2106805, 'LILIANE'), - (2106904, 'LILIANE'), - (2107001, 'LILIANE'), - (2107100, 'LILIANE'), - (2107209, 'LILIANE'), - (2107258, 'JBGOIS'), - (2107308, 'PATI'), - (2107357, 'LILIANE'), - (2107407, 'JBGOIS'), - (2107456, 'LILIANE'), - (2107506, 'LILIANE'), - (2107605, 'LILIANE'), - (2107704, 'PATI'), - (2107803, 'PATI'), - (2107902, 'PATI'), - (2108009, 'PATI'), - (2108058, 'LILIANE'), - (2108108, 'LILIANE'), - (2108207, 'JBGOIS'), - (2108256, 'LILIANE'), - (2108306, 'LILIANE'), - (2108405, 'LILIANE'), - (2108454, 'PATI'), - (2108504, 'LILIANE'), - (2108603, 'LILIANE'), - (2108702, 'JBGOIS'), - (2108801, 'LILIANE'), - (2108900, 'JBGOIS'), - (2109007, 'JBGOIS'), - (2109056, 'LILIANE'), - (2109106, 'JBGOIS'), - (2109205, 'LILIANE'), - (2109239, 'LILIANE'), - (2109270, 'LILIANE'), - (2109304, 'LILIANE'), - (2109403, 'LILIANE'), - (2109452, 'LILIANE'), - (2109502, 'JBGOIS'), - (2109551, 'LILIANE'), - (2109601, 'LILIANE'), - (2109700, 'JBGOIS'), - (2109759, 'JBGOIS'), - (2109809, 'LILIANE'), - (2109908, 'LILIANE'), - (2110005, 'LILIANE'), - (2110039, 'LILIANE'), - (2110104, 'PATI'), - (2110203, 'LILIANE'), - (2110237, 'PATI'), - (2110278, 'LILIANE'), - (2110302, 'JBGOIS'), - (2110401, 'PATI'), - (2110500, 'LILIANE'), - (2110609, 'PATI'), - (2110658, 'JBGOIS'), - (2110708, 'JBGOIS'), - (2110807, 'JBGOIS'), - (2110856, 'LILIANE'), - (2110906, 'PATI'), - (2111003, 'LILIANE'), - (2111029, 'LILIANE'), - (2111052, 'JBGOIS'), - (2111078, 'PATI'), - (2111102, 'PATI'), - (2111201, 'LILIANE'), - (2111250, 'JBGOIS'), - (2111300, 'LILIANE'), - (2111409, 'JBGOIS'), - (2111508, 'JBGOIS'), - (2111532, 'LILIANE'), - (2111573, 'JBGOIS'), - (2111607, 'JBGOIS'), - (2111631, 'JBGOIS'), - (2111672, 'JBGOIS'), - (2111706, 'LILIANE'), - (2111722, 'JBGOIS'), - (2111748, 'JBGOIS'), - (2111763, 'LILIANE'), - (2111789, 'LILIANE'), - (2111805, 'JBGOIS'), - (2111904, 'PATI'), - (2111953, 'PATI'), - (2112001, 'JBGOIS'), - (2112100, 'PATI'), - (2112209, 'PATI'), - (2112233, 'JBGOIS'), - (2112274, 'LILIANE'), - (2112308, 'JBGOIS'), - (2112407, 'LILIANE'), - (2112456, 'LILIANE'), - (2112506, 'LILIANE'), - (2112605, 'PATI'), - (2112704, 'LILIANE'), - (2112803, 'LILIANE'), - (2112852, 'LILIANE'), - (2112902, 'LILIANE'), - (2113009, 'LILIANE'), - (2114007, 'LILIANE'), - (2200053, 'OTTO'), - (2200103, 'janarycn'), - (2200202, 'janarycn'), - (2200251, 'OTTO'), - (2200277, 'OTTO'), - (2200301, 'janarycn'), - (2200400, 'janarycn'), - (2200459, 'janarycn'), - (2200509, 'janarycn'), - (2200608, 'janarycn'), - (2200707, 'janarycn'), - (2200806, 'janarycn'), - (2200905, 'janarycn'), - (2200954, 'OTTO'), - (2201002, 'janarycn'), - (2201051, 'janarycn'), - (2201101, 'janarycn'), - (2201150, 'janarycn'), - (2201176, 'janarycn'), - (2201200, 'ADAL'), - (2201309, 'janarycn'), - (2201408, 'janarycn'), - (2201507, 'ADAL'), - (2201556, 'OTTO'), - (2201572, 'OTTO'), - (2201606, 'janarycn'), - (2201705, 'janarycn'), - (2201739, 'OTTO'), - (2201770, 'ADAL'), - (2201804, 'OTTO'), - (2201903, 'janarycn'), - (2201919, 'ADAL'), - (2201929, 'janarycn'), - (2201945, 'janarycn'), - (2201960, 'ADAL'), - (2201988, 'janarycn'), - (2202000, 'ADAL'), - (2202026, 'janarycn'), - (2202059, 'ADAL'), - (2202075, 'OTTO'), - (2202083, 'ADAL'), - (2202091, 'OTTO'), - (2202109, 'OTTO'), - (2202117, 'OTTO'), - (2202133, 'OTTO'), - (2202174, 'ADAL'), - (2202208, 'janarycn'), - (2202251, 'janarycn'), - (2202307, 'janarycn'), - (2202406, 'janarycn'), - (2202455, 'OTTO'), - (2202505, 'janarycn'), - (2202539, 'ADAL'), - (2202554, 'OTTO'), - (2202604, 'janarycn'), - (2202653, 'ADAL'), - (2202703, 'ADAL'), - (2202711, 'janarycn'), - (2202729, 'ADAL'), - (2202737, 'janarycn'), - (2202752, 'janarycn'), - (2202778, 'OTTO'), - (2202802, 'OTTO'), - (2202851, 'janarycn'), - (2202901, 'janarycn'), - (2203008, 'janarycn'), - (2203107, 'janarycn'), - (2203206, 'janarycn'), - (2203230, 'janarycn'), - (2203271, 'OTTO'), - (2203255, 'janarycn'), - (2203305, 'janarycn'), - (2203354, 'janarycn'), - (2203404, 'OTTO'), - (2203453, 'janarycn'), - (2203420, 'janarycn'), - (2203503, 'janarycn'), - (2203602, 'janarycn'), - (2203701, 'ADAL'), - (2203750, 'janarycn'), - (2203800, 'janarycn'), - (2203859, 'OTTO'), - (2203909, 'janarycn'), - (2204006, 'janarycn'), - (2204105, 'janarycn'), - (2204154, 'OTTO'), - (2204204, 'OTTO'), - (2204303, 'OTTO'), - (2204352, 'OTTO'), - (2204402, 'janarycn'), - (2204501, 'janarycn'), - (2204550, 'janarycn'), - (2204600, 'janarycn'), - (2204659, 'ADAL'), - (2204709, 'janarycn'), - (2204808, 'OTTO'), - (2204907, 'OTTO'), - (2205003, 'OTTO'), - (2205102, 'janarycn'), - (2205151, 'OTTO'), - (2205201, 'OTTO'), - (2205250, 'janarycn'), - (2205276, 'janarycn'), - (2205300, 'janarycn'), - (2205359, 'OTTO'), - (2205409, 'ADAL'), - (2205458, 'ADAL'), - (2205508, 'janarycn'), - (2205516, 'janarycn'), - (2205524, 'janarycn'), - (2205532, 'janarycn'), - (2205557, 'janarycn'), - (2205573, 'janarycn'), - (2205565, 'OTTO'), - (2205581, 'janarycn'), - (2205599, 'janarycn'), - (2205540, 'janarycn'), - (2205607, 'janarycn'), - (2205706, 'ADAL'), - (2205805, 'ADAL'), - (2205854, 'ADAL'), - (2205904, 'janarycn'), - (2205953, 'OTTO'), - (2206001, 'janarycn'), - (2206050, 'OTTO'), - (2206100, 'ADAL'), - (2206209, 'ADAL'), - (2206308, 'janarycn'), - (2206357, 'janarycn'), - (2206407, 'janarycn'), - (2206506, 'OTTO'), - (2206605, 'janarycn'), - (2206654, 'janarycn'), - (2206670, 'ADAL'), - (2206696, 'ADAL'), - (2206704, 'janarycn'), - (2206720, 'janarycn'), - (2206753, 'janarycn'), - (2206803, 'ADAL'), - (2207959, 'OTTO'), - (2206902, 'janarycn'), - (2206951, 'janarycn'), - (2207009, 'OTTO'), - (2207108, 'janarycn'), - (2207207, 'OTTO'), - (2207306, 'OTTO'), - (2207355, 'janarycn'), - (2207405, 'janarycn'), - (2207504, 'janarycn'), - (2207553, 'OTTO'), - (2207603, 'janarycn'), - (2207702, 'ADAL'), - (2207751, 'janarycn'), - (2207777, 'OTTO'), - (2207793, 'janarycn'), - (2207801, 'OTTO'), - (2207850, 'janarycn'), - (2207900, 'janarycn'), - (2207934, 'OTTO'), - (2208007, 'OTTO'), - (2208106, 'janarycn'), - (2208205, 'OTTO'), - (2208304, 'ADAL'), - (2208403, 'ADAL'), - (2208502, 'ADAL'), - (2208551, 'janarycn'), - (2208601, 'janarycn'), - (2208650, 'OTTO'), - (2208700, 'janarycn'), - (2208809, 'janarycn'), - (2208858, 'janarycn'), - (2208874, 'OTTO'), - (2208908, 'janarycn'), - (2209005, 'janarycn'), - (2209104, 'OTTO'), - (2209153, 'janarycn'), - (2209203, 'janarycn'), - (2209302, 'janarycn'), - (2209377, 'OTTO'), - (2209351, 'OTTO'), - (2209401, 'OTTO'), - (2209450, 'janarycn'), - (2209500, 'OTTO'), - (2209559, 'janarycn'), - (2209609, 'janarycn'), - (2209658, 'OTTO'), - (2209708, 'janarycn'), - (2209757, 'janarycn'), - (2209807, 'janarycn'), - (2209856, 'OTTO'), - (2209872, 'ADAL'), - (2209906, 'janarycn'), - (2209955, 'OTTO'), - (2209971, 'ADAL'), - (2210003, 'OTTO'), - (2210052, 'ADAL'), - (2210102, 'janarycn'), - (2210201, 'OTTO'), - (2210300, 'OTTO'), - (2210359, 'janarycn'), - (2210375, 'OTTO'), - (2210383, 'janarycn'), - (2210391, 'janarycn'), - (2210409, 'janarycn'), - (2210508, 'janarycn'), - (2210607, 'janarycn'), - (2210623, 'janarycn'), - (2210631, 'janarycn'), - (2210656, 'janarycn'), - (2210706, 'OTTO'), - (2210805, 'OTTO'), - (2210904, 'OTTO'), - (2210938, 'OTTO'), - (2210953, 'janarycn'), - (2210979, 'OTTO'), - (2211001, 'janarycn'), - (2211100, 'janarycn'), - (2211209, 'janarycn'), - (2211308, 'janarycn'), - (2211357, 'janarycn'), - (2211407, 'janarycn'), - (2211506, 'OTTO'), - (2211605, 'OTTO'), - (2211704, 'OTTO'), - (2300101, 'TELMAV'), - (2300150, 'BLUZ'), - (2300200, 'BLUZ'), - (2300309, 'BLUZ'), - (2300408, 'BLUZ'), - (2300507, 'BLUZ'), - (2300606, 'TELMAV'), - (2300705, 'TELMAV'), - (2300754, 'BLUZ'), - (2300804, 'TELMAV'), - (2300903, 'BLUZ'), - (2301000, 'RONALDL'), - (2301109, 'TELMAV'), - (2301208, 'BLUZ'), - (2301257, 'BLUZ'), - (2301307, 'TELMAV'), - (2301406, 'BLUZ'), - (2301505, 'BLUZ'), - (2301604, 'TELMAV'), - (2301703, 'TELMAV'), - (2301802, 'TELMAV'), - (2301851, 'BLUZ'), - (2301901, 'TELMAV'), - (2301950, 'BLUZ'), - (2302008, 'TELMAV'), - (2302057, 'BLUZ'), - (2302107, 'BLUZ'), - (2302206, 'BLUZ'), - (2302305, 'BLUZ'), - (2302404, 'BLUZ'), - (2302503, 'TELMAV'), - (2302602, 'BLUZ'), - (2302701, 'TELMAV'), - (2302800, 'BLUZ'), - (2302909, 'BLUZ'), - (2303006, 'BLUZ'), - (2303105, 'BLUZ'), - (2303204, 'TELMAV'), - (2303303, 'TELMAV'), - (2303402, 'BLUZ'), - (2303501, 'BLUZ'), - (2303600, 'BLUZ'), - (2303659, 'BLUZ'), - (2303709, 'RONALDL'), - (2303808, 'TELMAV'), - (2303907, 'BLUZ'), - (2303931, 'BLUZ'), - (2303956, 'BLUZ'), - (2304004, 'BLUZ'), - (2304103, 'BLUZ'), - (2304202, 'TELMAV'), - (2304236, 'BLUZ'), - (2304251, 'BLUZ'), - (2304269, 'BLUZ'), - (2304277, 'TELMAV'), - (2304285, 'RONALDL'), - (2304301, 'TELMAV'), - (2304350, 'BLUZ'), - (2304400, 'RONALDL'), - (2304459, 'TELMAV'), - (2304509, 'BLUZ'), - (2304608, 'BLUZ'), - (2304657, 'BLUZ'), - (2304707, 'BLUZ'), - (2304806, 'TELMAV'), - (2304905, 'BLUZ'), - (2304954, 'RONALDL'), - (2305001, 'BLUZ'), - (2305100, 'BLUZ'), - (2305209, 'BLUZ'), - (2305233, 'RONALDL'), - (2305266, 'BLUZ'), - (2305308, 'BLUZ'), - (2305332, 'TELMAV'), - (2305357, 'TELMAV'), - (2305407, 'TELMAV'), - (2305506, 'TELMAV'), - (2305605, 'BLUZ'), - (2305654, 'BLUZ'), - (2305704, 'TELMAV'), - (2305803, 'BLUZ'), - (2305902, 'BLUZ'), - (2306009, 'TELMAV'), - (2306108, 'BLUZ'), - (2306207, 'TELMAV'), - (2306256, 'RONALDL'), - (2306306, 'BLUZ'), - (2306405, 'BLUZ'), - (2306504, 'BLUZ'), - (2306553, 'BLUZ'), - (2306603, 'BLUZ'), - (2306702, 'TELMAV'), - (2306801, 'TELMAV'), - (2306900, 'TELMAV'), - (2307007, 'TELMAV'), - (2307106, 'TELMAV'), - (2307205, 'TELMAV'), - (2307254, 'BLUZ'), - (2307304, 'TELMAV'), - (2307403, 'TELMAV'), - (2307502, 'TELMAV'), - (2307601, 'TELMAV'), - (2307635, 'BLUZ'), - (2307650, 'RONALDL'), - (2307700, 'RONALDL'), - (2307809, 'BLUZ'), - (2307908, 'BLUZ'), - (2308005, 'BLUZ'), - (2308104, 'TELMAV'), - (2308203, 'BLUZ'), - (2308302, 'TELMAV'), - (2308351, 'BLUZ'), - (2308377, 'BLUZ'), - (2308401, 'TELMAV'), - (2308500, 'BLUZ'), - (2308609, 'BLUZ'), - (2308708, 'TELMAV'), - (2308807, 'BLUZ'), - (2308906, 'BLUZ'), - (2309003, 'BLUZ'), - (2309102, 'BLUZ'), - (2309201, 'TELMAV'), - (2309300, 'BLUZ'), - (2309409, 'BLUZ'), - (2309458, 'BLUZ'), - (2309508, 'TELMAV'), - (2309607, 'RONALDL'), - (2309706, 'RONALDL'), - (2309805, 'BLUZ'), - (2309904, 'BLUZ'), - (2310001, 'TELMAV'), - (2310100, 'BLUZ'), - (2310209, 'BLUZ'), - (2310258, 'BLUZ'), - (2310308, 'BLUZ'), - (2310407, 'BLUZ'), - (2310506, 'BLUZ'), - (2310605, 'TELMAV'), - (2310704, 'BLUZ'), - (2310803, 'TELMAV'), - (2310852, 'BLUZ'), - (2310902, 'BLUZ'), - (2310951, 'BLUZ'), - (2311009, 'BLUZ'), - (2311108, 'TELMAV'), - (2311207, 'TELMAV'), - (2311231, 'TELMAV'), - (2311264, 'BLUZ'), - (2311306, 'BLUZ'), - (2311355, 'TELMAV'), - (2311405, 'BLUZ'), - (2311504, 'TELMAV'), - (2311603, 'BLUZ'), - (2311702, 'BLUZ'), - (2311801, 'TELMAV'), - (2311900, 'BLUZ'), - (2311959, 'TELMAV'), - (2312205, 'BLUZ'), - (2312007, 'BLUZ'), - (2312106, 'TELMAV'), - (2312304, 'BLUZ'), - (2312403, 'BLUZ'), - (2312502, 'TELMAV'), - (2312601, 'BLUZ'), - (2312700, 'BLUZ'), - (2312809, 'BLUZ'), - (2312908, 'BLUZ'), - (2313005, 'BLUZ'), - (2313104, 'TELMAV'), - (2313203, 'BLUZ'), - (2313252, 'TELMAV'), - (2313302, 'BLUZ'), - (2313351, 'BLUZ'), - (2313401, 'BLUZ'), - (2313500, 'BLUZ'), - (2313559, 'BLUZ'), - (2313609, 'BLUZ'), - (2313708, 'TELMAV'), - (2313757, 'BLUZ'), - (2313807, 'BLUZ'), - (2313906, 'BLUZ'), - (2313955, 'BLUZ'), - (2314003, 'TELMAV'), - (2314102, 'BLUZ'), - (2400109, 'MARGARET'), - (2400208, 'MARGARET'), - (2400307, 'MARGARET'), - (2400406, 'MARGARET'), - (2400505, 'MARGARET'), - (2400604, 'MARGARET'), - (2400703, 'MARGARET'), - (2400802, 'MARGARET'), - (2400901, 'MARGARET'), - (2401008, 'MARGARET'), - (2401107, 'MARGARET'), - (2401206, 'ADAL'), - (2401305, 'MARGARET'), - (2401404, 'ADAL'), - (2401453, 'MARGARET'), - (2401503, 'ADAL'), - (2401602, 'ADAL'), - (2401651, 'MARGARET'), - (2401701, 'ADAL'), - (2401800, 'ADAL'), - (2401859, 'MARGARET'), - (2401909, 'MARGARET'), - (2402006, 'MARGARET'), - (2402105, 'ADAL'), - (2402204, 'ADAL'), - (2402303, 'MARGARET'), - (2402402, 'MARGARET'), - (2402501, 'MARGARET'), - (2402600, 'ADAL'), - (2402709, 'MARGARET'), - (2402808, 'ADAL'), - (2402907, 'MARGARET'), - (2403004, 'MARGARET'), - (2403103, 'MARGARET'), - (2403202, 'MARGARET'), - (2403301, 'MARGARET'), - (2403400, 'MARGARET'), - (2403509, 'ADAL'), - (2403608, 'ADAL'), - (2403707, 'MARGARET'), - (2403756, 'MARGARET'), - (2403806, 'MARGARET'), - (2403905, 'MARGARET'), - (2404002, 'MARGARET'), - (2404101, 'MARGARET'), - (2404200, 'ADAL'), - (2404309, 'MARGARET'), - (2404408, 'MARGARET'), - (2404507, 'MARGARET'), - (2404606, 'ADAL'), - (2404705, 'MARGARET'), - (2404804, 'MARGARET'), - (2404853, 'MARGARET'), - (2404903, 'MARGARET'), - (2405009, 'ADAL'), - (2405108, 'ADAL'), - (2405207, 'MARGARET'), - (2405306, 'ADAL'), - (2405405, 'ADAL'), - (2405504, 'MARGARET'), - (2405603, 'MARGARET'), - (2405702, 'MARGARET'), - (2405801, 'ADAL'), - (2405900, 'MARGARET'), - (2406007, 'MARGARET'), - (2406106, 'MARGARET'), - (2406155, 'ADAL'), - (2406205, 'ADAL'), - (2406304, 'ADAL'), - (2406403, 'ADAL'), - (2406502, 'MARGARET'), - (2406601, 'ADAL'), - (2406700, 'MARGARET'), - (2406809, 'ADAL'), - (2406908, 'MARGARET'), - (2407005, 'MARGARET'), - (2407104, 'ADAL'), - (2407203, 'MARGARET'), - (2407252, 'MARGARET'), - (2407302, 'MARGARET'), - (2407401, 'MARGARET'), - (2407500, 'ADAL'), - (2407609, 'MARGARET'), - (2407708, 'ADAL'), - (2407807, 'ADAL'), - (2407906, 'ADAL'), - (2408003, 'MARGARET'), - (2408102, 'ADAL'), - (2408201, 'ADAL'), - (2408300, 'ADAL'), - (2408409, 'MARGARET'), - (2408508, 'MARGARET'), - (2408607, 'MARGARET'), - (2408706, 'MARGARET'), - (2408805, 'ADAL'), - (2408904, 'MARGARET'), - (2403251, 'ADAL'), - (2409100, 'ADAL'), - (2409209, 'ADAL'), - (2409308, 'MARGARET'), - (2409407, 'MARGARET'), - (2409506, 'ADAL'), - (2409605, 'MARGARET'), - (2409704, 'MARGARET'), - (2409803, 'ADAL'), - (2409902, 'MARGARET'), - (2410009, 'MARGARET'), - (2410108, 'ADAL'), - (2410207, 'MARGARET'), - (2410256, 'MARGARET'), - (2410405, 'ADAL'), - (2410504, 'MARGARET'), - (2410603, 'MARGARET'), - (2410702, 'MARGARET'), - (2410801, 'MARGARET'), - (2410900, 'ADAL'), - (2408953, 'ADAL'), - (2411007, 'MARGARET'), - (2411106, 'ADAL'), - (2411205, 'ADAL'), - (2409332, 'ADAL'), - (2411403, 'MARGARET'), - (2411429, 'MARGARET'), - (2411502, 'ADAL'), - (2411601, 'MARGARET'), - (2411700, 'ADAL'), - (2411809, 'MARGARET'), - (2411908, 'MARGARET'), - (2412005, 'ADAL'), - (2412104, 'MARGARET'), - (2412203, 'ADAL'), - (2412302, 'ADAL'), - (2412401, 'MARGARET'), - (2412500, 'MARGARET'), - (2412559, 'ADAL'), - (2412609, 'ADAL'), - (2412708, 'ADAL'), - (2412807, 'MARGARET'), - (2412906, 'ADAL'), - (2413003, 'MARGARET'), - (2413102, 'ADAL'), - (2413201, 'ADAL'), - (2410306, 'ADAL'), - (2413300, 'ADAL'), - (2413359, 'MARGARET'), - (2413409, 'MARGARET'), - (2413508, 'ADAL'), - (2413557, 'MARGARET'), - (2413607, 'MARGARET'), - (2413706, 'ADAL'), - (2413805, 'MARGARET'), - (2413904, 'ADAL'), - (2414001, 'ADAL'), - (2414100, 'MARGARET'), - (2414159, 'MARGARET'), - (2411056, 'MARGARET'), - (2414209, 'ADAL'), - (2414308, 'MARGARET'), - (2414407, 'ADAL'), - (2414456, 'MARGARET'), - (2414506, 'MARGARET'), - (2414605, 'MARGARET'), - (2414704, 'ADAL'), - (2414753, 'MARGARET'), - (2414803, 'ADAL'), - (2414902, 'MARGARET'), - (2415008, 'ADAL'), - (2502003, 'RONALDL'), - (2502300, 'RONALDL'), - (2502805, 'RONALDL'), - (2502904, 'RONALDL'), - (2504306, 'RONALDL'), - (2507408, 'RONALDL'), - (2508109, 'RONALDL'), - (2509370, 'RONALDL'), - (2512804, 'RONALDL'), - (2513901, 'RONALDL'), - (2514651, 'RONALDL'), - (2500700, 'RONALDL'), - (2502052, 'RONALDL'), - (2502201, 'RONALDL'), - (2502409, 'RONALDL'), - (2503308, 'RONALDL'), - (2503704, 'RONALDL'), - (2504108, 'RONALDL'), - (2509602, 'RONALDL'), - (2512036, 'RONALDL'), - (2512077, 'RONALDL'), - (2513307, 'RONALDL'), - (2513653, 'RONALDL'), - (2514503, 'RONALDL'), - (2516805, 'RONALDL'), - (2516904, 'RONALDL'), - (2500775, 'RONALDL'), - (2503753, 'RONALDL'), - (2504504, 'RONALDL'), - (2505501, 'RONALDL'), - (2508406, 'RONALDL'), - (2508802, 'RONALDL'), - (2509156, 'RONALDL'), - (2510006, 'RONALDL'), - (2510907, 'RONALDL'), - (2512101, 'RONALDL'), - (2513208, 'RONALDL'), - (2513927, 'RONALDL'), - (2513968, 'RONALDL'), - (2513984, 'RONALDL'), - (2514206, 'RONALDL'), - (2516201, 'RONALDL'), - (2517209, 'RONALDL'), - (2501153, 'RONALDL'), - (2503407, 'RONALDL'), - (2508703, 'RONALDL'), - (2510709, 'RONALDL'), - (2510808, 'RONALDL'), - (2512606, 'RONALDL'), - (2513802, 'RONALDL'), - (2514404, 'RONALDL'), - (2514602, 'RONALDL'), - (2500205, 'RONALDL'), - (2502607, 'RONALDL'), - (2504207, 'RONALDL'), - (2504801, 'RONALDL'), - (2505907, 'RONALDL'), - (2510204, 'RONALDL'), - (2510402, 'RONALDL'), - (2511301, 'RONALDL'), - (2513604, 'RONALDL'), - (2502102, 'RONALDL'), - (2504405, 'RONALDL'), - (2505303, 'RONALDL'), - (2505600, 'RONALDL'), - (2506608, 'RONALDL'), - (2507002, 'RONALDL'), - (2511004, 'RONALDL'), - (2513356, 'RONALDL'), - (2513505, 'RONALDL'), - (2514305, 'RONALDL'), - (2515708, 'RONALDL'), - (2500106, 'RONALDL'), - (2503555, 'RONALDL'), - (2505402, 'RONALDL'), - (2506707, 'RONALDL'), - (2508000, 'RONALDL'), - (2509008, 'RONALDL'), - (2509396, 'RONALDL'), - (2512309, 'RONALDL'), - (2514552, 'RONALDL'), - (2516607, 'RONALDL'), - (2516706, 'RONALDL'), - (2507804, 'RONALDL'), - (2513000, 'RONALDL'), - (2513406, 'RONALDL'), - (2514701, 'RONALDL'), - (2514909, 'RONALDL'), - (2517100, 'RONALDL'), - (2501534, 'RONALDL'), - (2505006, 'RONALDL'), - (2506202, 'RONALDL'), - (2507705, 'RONALDL'), - (2510303, 'RONALDL'), - (2511103, 'RONALDL'), - (2511400, 'RONALDL'), - (2515401, 'RONALDL'), - (2516755, 'RONALDL'), - (2500734, 'RONALDL'), - (2501351, 'RONALDL'), - (2503902, 'RONALDL'), - (2504702, 'RONALDL'), - (2504850, 'RONALDL'), - (2508505, 'RONALDL'), - (2509701, 'RONALDL'), - (2510600, 'RONALDL'), - (2510659, 'RONALDL'), - (2512200, 'RONALDL'), - (2514107, 'RONALDL'), - (2514800, 'RONALDL'), - (2515203, 'RONALDL'), - (2515500, 'RONALDL'), - (2516300, 'RONALDL'), - (2516508, 'RONALDL'), - (2517407, 'RONALDL'), - (2500536, 'RONALDL'), - (2501575, 'RONALDL'), - (2501708, 'RONALDL'), - (2502508, 'RONALDL'), - (2503100, 'RONALDL'), - (2504074, 'RONALDL'), - (2504355, 'RONALDL'), - (2506509, 'RONALDL'), - (2512788, 'RONALDL'), - (2513851, 'RONALDL'), - (2513943, 'RONALDL'), - (2514008, 'RONALDL'), - (2500577, 'RAFAHLS'), - (2500908, 'RAFAHLS'), - (2501609, 'RAFAHLS'), - (2505105, 'RAFAHLS'), - (2505352, 'RAFAHLS'), - (2510105, 'RAFAHLS'), - (2510501, 'RAFAHLS'), - (2512002, 'RAFAHLS'), - (2512705, 'RAFAHLS'), - (2516102, 'RAFAHLS'), - (2516151, 'RAFAHLS'), - (2501005, 'RAFAHLS'), - (2503506, 'RAFAHLS'), - (2504157, 'RAFAHLS'), - (2505709, 'RAFAHLS'), - (2512747, 'RAFAHLS'), - (2516003, 'RAFAHLS'), - (2516409, 'RAFAHLS'), - (2501203, 'RAFAHLS'), - (2506004, 'RAFAHLS'), - (2509503, 'RAFAHLS'), - (2515104, 'RAFAHLS'), - (2500304, 'RAFAHLS'), - (2500403, 'RAFAHLS'), - (2501104, 'RAFAHLS'), - (2501500, 'RAFAHLS'), - (2502706, 'RAFAHLS'), - (2509339, 'RAFAHLS'), - (2511608, 'RAFAHLS'), - (2515906, 'RAFAHLS'), - (2500502, 'RAFAHLS'), - (2500809, 'RAFAHLS'), - (2501906, 'RAFAHLS'), - (2503605, 'RAFAHLS'), - (2505204, 'RAFAHLS'), - (2505808, 'RAFAHLS'), - (2506301, 'RAFAHLS'), - (2508208, 'RAFAHLS'), - (2508554, 'RAFAHLS'), - (2509800, 'RAFAHLS'), - (2511707, 'RAFAHLS'), - (2511806, 'RAFAHLS'), - (2515609, 'RAFAHLS'), - (2515930, 'RAFAHLS'), - (2502151, 'RAFAHLS'), - (2504009, 'RAFAHLS'), - (2506103, 'RAFAHLS'), - (2508307, 'RAFAHLS'), - (2509206, 'RAFAHLS'), - (2512408, 'RAFAHLS'), - (2512507, 'RAFAHLS'), - (2515807, 'RAFAHLS'), - (2503803, 'RAFAHLS'), - (2506400, 'RAFAHLS'), - (2506806, 'RAFAHLS'), - (2506905, 'RAFAHLS'), - (2507200, 'RAFAHLS'), - (2507606, 'RAFAHLS'), - (2509404, 'RAFAHLS'), - (2512754, 'RAFAHLS'), - (2513109, 'RAFAHLS'), - (2501302, 'RAFAHLS'), - (2506251, 'RAFAHLS'), - (2509909, 'RAFAHLS'), - (2513158, 'RAFAHLS'), - (2517001, 'RAFAHLS'), - (2501401, 'RAFAHLS'), - (2504033, 'RAFAHLS'), - (2505238, 'RAFAHLS'), - (2505279, 'RAFAHLS'), - (2507101, 'RAFAHLS'), - (2507309, 'RAFAHLS'), - (2508901, 'RAFAHLS'), - (2509057, 'RAFAHLS'), - (2509305, 'RAFAHLS'), - (2512721, 'RAFAHLS'), - (2512903, 'RAFAHLS'), - (2504900, 'RAFAHLS'), - (2507903, 'RAFAHLS'), - (2509107, 'RAFAHLS'), - (2511509, 'RAFAHLS'), - (2512762, 'RAFAHLS'), - (2514453, 'RAFAHLS'), - (2515005, 'RAFAHLS'), - (2515302, 'RAFAHLS'), - (2515971, 'RAFAHLS'), - (2501807, 'RAFAHLS'), - (2503209, 'RAFAHLS'), - (2504603, 'RAFAHLS'), - (2507507, 'RAFAHLS'), - (2508604, 'RAFAHLS'), - (2513703, 'RAFAHLS'), - (2500601, 'RAFAHLS'), - (2503001, 'RAFAHLS'), - (2511202, 'RAFAHLS'), - (2511905, 'RAFAHLS'), - (2601102, 'janarycn'), - (2602001, 'janarycn'), - (2605301, 'janarycn'), - (2606309, 'janarycn'), - (2607307, 'janarycn'), - (2609907, 'janarycn'), - (2612455, 'janarycn'), - (2612554, 'janarycn'), - (2614303, 'janarycn'), - (2615607, 'janarycn'), - (2604304, 'janarycn'), - (2609303, 'janarycn'), - (2610400, 'janarycn'), - (2612208, 'janarycn'), - (2613503, 'janarycn'), - (2614006, 'janarycn'), - (2616100, 'janarycn'), - (2600104, 'janarycn'), - (2602506, 'janarycn'), - (2603405, 'janarycn'), - (2603900, 'janarycn'), - (2605608, 'janarycn'), - (2606903, 'janarycn'), - (2607109, 'janarycn'), - (2607703, 'janarycn'), - (2611533, 'janarycn'), - (2612471, 'janarycn'), - (2612802, 'janarycn'), - (2613602, 'janarycn'), - (2613909, 'janarycn'), - (2614402, 'janarycn'), - (2614600, 'janarycn'), - (2615706, 'janarycn'), - (2615904, 'janarycn'), - (2601201, 'janarycn'), - (2601805, 'janarycn'), - (2605103, 'janarycn'), - (2606606, 'janarycn'), - (2607000, 'janarycn'), - (2609154, 'janarycn'), - (2614105, 'janarycn'), - (2600203, 'LFERNAN'), - (2603009, 'LFERNAN'), - (2605152, 'LFERNAN'), - (2608750, 'LFERNAN'), - (2609808, 'LFERNAN'), - (2611101, 'LFERNAN'), - (2612604, 'LFERNAN'), - (2615201, 'LFERNAN'), - (2601607, 'LFERNAN'), - (2603926, 'LFERNAN'), - (2605707, 'LFERNAN'), - (2607406, 'LFERNAN'), - (2608057, 'LFERNAN'), - (2611002, 'LFERNAN'), - (2614808, 'LFERNAN'), - (2600500, 'LFERNAN'), - (2602803, 'LFERNAN'), - (2607505, 'LFERNAN'), - (2610806, 'LFERNAN'), - (2615805, 'LFERNAN'), - (2616001, 'LFERNAN'), - (2600609, 'LFERNAN'), - (2601706, 'LFERNAN'), - (2601904, 'LFERNAN'), - (2602605, 'LFERNAN'), - (2603108, 'LFERNAN'), - (2603801, 'LFERNAN'), - (2604106, 'LFERNAN'), - (2606408, 'LFERNAN'), - (2608008, 'LFERNAN'), - (2610905, 'LFERNAN'), - (2611200, 'LFERNAN'), - (2611705, 'LFERNAN'), - (2612406, 'LFERNAN'), - (2613008, 'LFERNAN'), - (2613107, 'LFERNAN'), - (2614709, 'LFERNAN'), - (2604155, 'LFERNAN'), - (2605806, 'LFERNAN'), - (2612505, 'LFERNAN'), - (2612703, 'LFERNAN'), - (2614501, 'LFERNAN'), - (2615003, 'LFERNAN'), - (2615409, 'LFERNAN'), - (2616183, 'LFERNAN'), - (2616209, 'LFERNAN'), - (2602209, 'LFERNAN'), - (2604908, 'LFERNAN'), - (2605400, 'LFERNAN'), - (2608107, 'LFERNAN'), - (2608909, 'LFERNAN'), - (2609105, 'LFERNAN'), - (2609709, 'LFERNAN'), - (2610509, 'LFERNAN'), - (2612109, 'LFERNAN'), - (2613800, 'LFERNAN'), - (2601003, 'LFERNAN'), - (2602100, 'LFERNAN'), - (2602407, 'LFERNAN'), - (2603207, 'LFERNAN'), - (2603306, 'LFERNAN'), - (2603702, 'LFERNAN'), - (2604700, 'LFERNAN'), - (2606002, 'LFERNAN'), - (2606507, 'LFERNAN'), - (2608255, 'LFERNAN'), - (2608305, 'LFERNAN'), - (2608404, 'LFERNAN'), - (2608602, 'LFERNAN'), - (2608800, 'LFERNAN'), - (2610103, 'LFERNAN'), - (2610301, 'LFERNAN'), - (2612307, 'LFERNAN'), - (2613206, 'LFERNAN'), - (2615102, 'LFERNAN'), - (2600302, 'LFERNAN'), - (2600807, 'LFERNAN'), - (2601300, 'LFERNAN'), - (2602308, 'LFERNAN'), - (2603504, 'LFERNAN'), - (2605004, 'LFERNAN'), - (2606705, 'LFERNAN'), - (2608701, 'LFERNAN'), - (2610202, 'LFERNAN'), - (2612000, 'LFERNAN'), - (2613305, 'LFERNAN'), - (2600708, 'JBGOIS'), - (2602704, 'JBGOIS'), - (2603603, 'JBGOIS'), - (2604007, 'JBGOIS'), - (2604601, 'JBGOIS'), - (2605509, 'JBGOIS'), - (2606200, 'JBGOIS'), - (2607653, 'JBGOIS'), - (2607802, 'JBGOIS'), - (2608453, 'JBGOIS'), - (2608503, 'JBGOIS'), - (2609006, 'JBGOIS'), - (2609501, 'JBGOIS'), - (2610608, 'JBGOIS'), - (2615300, 'JBGOIS'), - (2615508, 'JBGOIS'), - (2616308, 'JBGOIS'), - (2604403, 'JBGOIS'), - (2604502, 'JBGOIS'), - (2606101, 'JBGOIS'), - (2611309, 'JBGOIS'), - (2616407, 'JBGOIS'), - (2600401, 'JBGOIS'), - (2600906, 'JBGOIS'), - (2601409, 'JBGOIS'), - (2601508, 'JBGOIS'), - (2604205, 'JBGOIS'), - (2604809, 'JBGOIS'), - (2605202, 'JBGOIS'), - (2605905, 'JBGOIS'), - (2607950, 'JBGOIS'), - (2608206, 'JBGOIS'), - (2609204, 'JBGOIS'), - (2610004, 'JBGOIS'), - (2611408, 'JBGOIS'), - (2611507, 'JBGOIS'), - (2611804, 'JBGOIS'), - (2611903, 'JBGOIS'), - (2612901, 'JBGOIS'), - (2613404, 'JBGOIS'), - (2614204, 'JBGOIS'), - (2614857, 'JBGOIS'), - (2616506, 'JBGOIS'), - (2601052, 'JBGOIS'), - (2606804, 'JBGOIS'), - (2607604, 'JBGOIS'), - (2607752, 'JBGOIS'), - (2600054, 'JBGOIS'), - (2603454, 'JBGOIS'), - (2607901, 'JBGOIS'), - (2609402, 'JBGOIS'), - (2609600, 'JBGOIS'), - (2610707, 'JBGOIS'), - (2611606, 'JBGOIS'), - (2613701, 'JBGOIS'), - (2602902, 'JBGOIS'), - (2607208, 'JBGOIS'), - (2605459, 'JBGOIS'), - (2700102, 'LILIANE'), - (2700201, 'ADAL'), - (2700409, 'ADAL'), - (2700508, 'ADAL'), - (2700706, 'LILIANE'), - (2702405, 'LILIANE'), - (2700805, 'LILIANE'), - (2700904, 'LILIANE'), - (2701001, 'ADAL'), - (2702504, 'LILIANE'), - (2701100, 'ADAL'), - (2701209, 'LILIANE'), - (2701308, 'ADAL'), - (2701357, 'ADAL'), - (2701407, 'ADAL'), - (2708006, 'LILIANE'), - (2701506, 'LILIANE'), - (2708956, 'LILIANE'), - (2701605, 'LILIANE'), - (2701704, 'ADAL'), - (2701803, 'LILIANE'), - (2701902, 'ADAL'), - (2702009, 'LILIANE'), - (2702108, 'ADAL'), - (2705705, 'LILIANE'), - (2702207, 'ADAL'), - (2702306, 'ADAL'), - (2702355, 'LILIANE'), - (2702553, 'LILIANE'), - (2702603, 'LILIANE'), - (2702702, 'ADAL'), - (2702801, 'ADAL'), - (2702900, 'LILIANE'), - (2706307, 'LILIANE'), - (2703007, 'ADAL'), - (2703106, 'LILIANE'), - (2703205, 'ADAL'), - (2700300, 'LILIANE'), - (2703304, 'LILIANE'), - (2703403, 'LILIANE'), - (2703502, 'ADAL'), - (2703601, 'ADAL'), - (2703700, 'LILIANE'), - (2703759, 'ADAL'), - (2703809, 'ADAL'), - (2703908, 'ADAL'), - (2704005, 'ADAL'), - (2704104, 'LILIANE'), - (2704203, 'LILIANE'), - (2709202, 'LILIANE'), - (2704302, 'ADAL'), - (2704401, 'LILIANE'), - (2704906, 'LILIANE'), - (2704609, 'LILIANE'), - (2708303, 'ADAL'), - (2709301, 'ADAL'), - (2704807, 'LILIANE'), - (2705002, 'LILIANE'), - (2705200, 'ADAL'), - (2705309, 'LILIANE'), - (2705408, 'LILIANE'), - (2705606, 'ADAL'), - (2705804, 'LILIANE'), - (2705903, 'LILIANE'), - (2706000, 'LILIANE'), - (2706109, 'LILIANE'), - (2706208, 'LILIANE'), - (2705101, 'ADAL'), - (2706406, 'LILIANE'), - (2705507, 'ADAL'), - (2706422, 'LILIANE'), - (2707305, 'ADAL'), - (2706448, 'ADAL'), - (2706505, 'ADAL'), - (2704500, 'ADAL'), - (2706604, 'LILIANE'), - (2706802, 'ADAL'), - (2706901, 'ADAL'), - (2707008, 'ADAL'), - (2700607, 'ADAL'), - (2707107, 'LILIANE'), - (2707206, 'LILIANE'), - (2704708, 'ADAL'), - (2707404, 'ADAL'), - (2707503, 'ADAL'), - (2707701, 'ADAL'), - (2707602, 'LILIANE'), - (2707800, 'ADAL'), - (2707909, 'ADAL'), - (2708105, 'ADAL'), - (2708204, 'LILIANE'), - (2708402, 'LILIANE'), - (2708501, 'ADAL'), - (2708600, 'ADAL'), - (2708709, 'ADAL'), - (2708808, 'LILIANE'), - (2709152, 'ADAL'), - (2708907, 'ADAL'), - (2709004, 'LILIANE'), - (2706703, 'ADAL'), - (2709103, 'LILIANE'), - (2709400, 'ADAL'), - (2801207, 'pillarap'), - (2802205, 'pillarap'), - (2802403, 'pillarap'), - (2802601, 'pillarap'), - (2803104, 'pillarap'), - (2804201, 'pillarap'), - (2804508, 'pillarap'), - (2805406, 'pillarap'), - (2805604, 'pillarap'), - (2801405, 'pillarap'), - (2802304, 'pillarap'), - (2804458, 'pillarap'), - (2805000, 'pillarap'), - (2805208, 'pillarap'), - (2806008, 'pillarap'), - (2800209, 'pillarap'), - (2801900, 'pillarap'), - (2803807, 'pillarap'), - (2804300, 'pillarap'), - (2804607, 'pillarap'), - (2807006, 'pillarap'), - (2800506, 'pillarap'), - (2801009, 'pillarap'), - (2802908, 'pillarap'), - (2803708, 'pillarap'), - (2803906, 'pillarap'), - (2804102, 'pillarap'), - (2806800, 'pillarap'), - (2805505, 'pillarap'), - (2807105, 'pillarap'), - (2807402, 'pillarap'), - (2803500, 'pillarap'), - (2805802, 'pillarap'), - (2800100, 'robsoner'), - (2800704, 'robsoner'), - (2801108, 'robsoner'), - (2801603, 'robsoner'), - (2802700, 'robsoner'), - (2804409, 'robsoner'), - (2804706, 'robsoner'), - (2805703, 'robsoner'), - (2806404, 'robsoner'), - (2807303, 'robsoner'), - (2801306, 'robsoner'), - (2802007, 'robsoner'), - (2806503, 'robsoner'), - (2807204, 'robsoner'), - (2803302, 'robsoner'), - (2803401, 'robsoner'), - (2804904, 'robsoner'), - (2805307, 'robsoner'), - (2806909, 'robsoner'), - (2801504, 'robsoner'), - (2802502, 'robsoner'), - (2803609, 'robsoner'), - (2804003, 'robsoner'), - (2805901, 'robsoner'), - (2806107, 'robsoner'), - (2806602, 'robsoner'), - (2800308, 'robsoner'), - (2800605, 'robsoner'), - (2804805, 'robsoner'), - (2806701, 'robsoner'), - (2800407, 'robsoner'), - (2800670, 'robsoner'), - (2801702, 'robsoner'), - (2803005, 'robsoner'), - (2805109, 'robsoner'), - (2806206, 'robsoner'), - (2807501, 'robsoner'), - (2807600, 'robsoner'), - (2802106, 'robsoner'), - (2802809, 'robsoner'), - (2803203, 'robsoner'), - (2806305, 'robsoner'), - (2900108, 'pillarap'), - (2900207, 'TELMAV'), - (2900306, 'RAFAHLS'), - (2900355, 'RAFAHLS'), - (2900405, 'pillarap'), - (2900603, 'pillarap'), - (2900702, 'RAFAHLS'), - (2900801, 'PATI'), - (2900900, 'PATI'), - (2901007, 'pillarap'), - (2901106, 'pillarap'), - (2901155, 'pillarap'), - (2901205, 'pillarap'), - (2901304, 'pillarap'), - (2901353, 'pillarap'), - (2901403, 'TELMAV'), - (2901502, 'pillarap'), - (2901601, 'RAFAHLS'), - (2901700, 'pillarap'), - (2901809, 'pillarap'), - (2901908, 'RAFAHLS'), - (2901957, 'pillarap'), - (2902054, 'RAFAHLS'), - (2902005, 'pillarap'), - (2902104, 'RAFAHLS'), - (2902203, 'RAFAHLS'), - (2902252, 'PATI'), - (2902302, 'pillarap'), - (2902401, 'PATI'), - (2902500, 'TELMAV'), - (2902609, 'pillarap'), - (2902658, 'RAFAHLS'), - (2902708, 'TELMAV'), - (2902807, 'pillarap'), - (2902906, 'pillarap'), - (2903003, 'pillarap'), - (2903102, 'PATI'), - (2903201, 'TELMAV'), - (2903235, 'pillarap'), - (2903300, 'PATI'), - (2903276, 'RAFAHLS'), - (2903409, 'PATI'), - (2903508, 'pillarap'), - (2903607, 'RAFAHLS'), - (2903706, 'pillarap'), - (2903805, 'pillarap'), - (2903904, 'TELMAV'), - (2903953, 'pillarap'), - (2904001, 'pillarap'), - (2904050, 'pillarap'), - (2904100, 'pillarap'), - (2904209, 'pillarap'), - (2904308, 'pillarap'), - (2904407, 'TELMAV'), - (2904506, 'pillarap'), - (2904605, 'pillarap'), - (2904704, 'PATI'), - (2904753, 'TELMAV'), - (2904803, 'pillarap'), - (2904852, 'pillarap'), - (2904902, 'pillarap'), - (2905008, 'pillarap'), - (2905107, 'pillarap'), - (2905156, 'pillarap'), - (2905206, 'pillarap'), - (2905305, 'pillarap'), - (2905404, 'PATI'), - (2905503, 'pillarap'), - (2905602, 'PATI'), - (2905701, 'pillarap'), - (2905800, 'PATI'), - (2905909, 'TELMAV'), - (2906006, 'pillarap'), - (2906105, 'TELMAV'), - (2906204, 'pillarap'), - (2906303, 'PATI'), - (2906402, 'RAFAHLS'), - (2906501, 'pillarap'), - (2906600, 'pillarap'), - (2906709, 'pillarap'), - (2906808, 'RAFAHLS'), - (2906824, 'RAFAHLS'), - (2906857, 'RAFAHLS'), - (2906873, 'pillarap'), - (2906899, 'pillarap'), - (2906907, 'PATI'), - (2907004, 'RAFAHLS'), - (2907103, 'TELMAV'), - (2907202, 'TELMAV'), - (2907301, 'pillarap'), - (2907400, 'TELMAV'), - (2907509, 'pillarap'), - (2907558, 'pillarap'), - (2907608, 'pillarap'), - (2907707, 'TELMAV'), - (2907806, 'RAFAHLS'), - (2907905, 'RAFAHLS'), - (2908002, 'PATI'), - (2908101, 'TELMAV'), - (2908200, 'pillarap'), - (2908309, 'pillarap'), - (2908408, 'RAFAHLS'), - (2908507, 'pillarap'), - (2908606, 'RAFAHLS'), - (2908705, 'pillarap'), - (2908804, 'pillarap'), - (2908903, 'pillarap'), - (2909000, 'pillarap'), - (2909109, 'TELMAV'), - (2909208, 'RAFAHLS'), - (2909307, 'TELMAV'), - (2909406, 'TELMAV'), - (2909505, 'pillarap'), - (2909604, 'RAFAHLS'), - (2909703, 'TELMAV'), - (2909802, 'pillarap'), - (2909901, 'TELMAV'), - (2910008, 'pillarap'), - (2910057, 'pillarap'), - (2910107, 'pillarap'), - (2910206, 'pillarap'), - (2910305, 'pillarap'), - (2910404, 'pillarap'), - (2910503, 'RAFAHLS'), - (2900504, 'pillarap'), - (2910602, 'RAFAHLS'), - (2910701, 'RAFAHLS'), - (2910727, 'PATI'), - (2910750, 'RAFAHLS'), - (2910776, 'TELMAV'), - (2910800, 'pillarap'), - (2910859, 'pillarap'), - (2910909, 'PATI'), - (2911006, 'PATI'), - (2911105, 'TELMAV'), - (2911204, 'PATI'), - (2911253, 'RAFAHLS'), - (2911303, 'pillarap'), - (2911402, 'TELMAV'), - (2911501, 'PATI'), - (2911600, 'pillarap'), - (2911659, 'pillarap'), - (2911709, 'pillarap'), - (2911808, 'PATI'), - (2911857, 'RAFAHLS'), - (2911907, 'pillarap'), - (2912004, 'pillarap'), - (2912103, 'PATI'), - (2912202, 'pillarap'), - (2912301, 'pillarap'), - (2912400, 'pillarap'), - (2912509, 'pillarap'), - (2912608, 'pillarap'), - (2912707, 'PATI'), - (2912806, 'PATI'), - (2912905, 'PATI'), - (2913002, 'pillarap'), - (2913101, 'pillarap'), - (2913200, 'TELMAV'), - (2913309, 'RAFAHLS'), - (2913408, 'pillarap'), - (2913457, 'PATI'), - (2913507, 'pillarap'), - (2913606, 'PATI'), - (2913705, 'RAFAHLS'), - (2913804, 'pillarap'), - (2913903, 'PATI'), - (2914000, 'pillarap'), - (2914109, 'pillarap'), - (2914208, 'pillarap'), - (2914307, 'pillarap'), - (2914406, 'pillarap'), - (2914505, 'pillarap'), - (2914604, 'pillarap'), - (2914653, 'PATI'), - (2914703, 'pillarap'), - (2914802, 'PATI'), - (2914901, 'PATI'), - (2915007, 'pillarap'), - (2915106, 'pillarap'), - (2915205, 'PATI'), - (2915304, 'PATI'), - (2915353, 'TELMAV'), - (2915403, 'PATI'), - (2915502, 'PATI'), - (2915601, 'PATI'), - (2915700, 'PATI'), - (2915809, 'pillarap'), - (2915908, 'pillarap'), - (2916005, 'PATI'), - (2916104, 'pillarap'), - (2916203, 'PATI'), - (2916302, 'PATI'), - (2916401, 'pillarap'), - (2916500, 'RAFAHLS'), - (2916609, 'PATI'), - (2916708, 'pillarap'), - (2916807, 'pillarap'), - (2916856, 'pillarap'), - (2916906, 'pillarap'), - (2917003, 'pillarap'), - (2917102, 'pillarap'), - (2917201, 'pillarap'), - (2917300, 'PATI'), - (2917334, 'pillarap'), - (2917359, 'TELMAV'), - (2917409, 'pillarap'), - (2917508, 'pillarap'), - (2917607, 'pillarap'), - (2917706, 'pillarap'), - (2917805, 'pillarap'), - (2917904, 'RAFAHLS'), - (2918001, 'pillarap'), - (2918100, 'RAFAHLS'), - (2918209, 'pillarap'), - (2918308, 'pillarap'), - (2918357, 'pillarap'), - (2918407, 'TELMAV'), - (2918456, 'PATI'), - (2918506, 'pillarap'), - (2918555, 'PATI'), - (2918605, 'pillarap'), - (2918704, 'pillarap'), - (2918753, 'pillarap'), - (2918803, 'pillarap'), - (2918902, 'PATI'), - (2919009, 'pillarap'), - (2919058, 'pillarap'), - (2919108, 'RAFAHLS'), - (2919157, 'pillarap'), - (2919207, 'pillarap'), - (2919306, 'pillarap'), - (2919405, 'pillarap'), - (2919504, 'pillarap'), - (2919553, 'TELMAV'), - (2919603, 'pillarap'), - (2919702, 'pillarap'), - (2919801, 'pillarap'), - (2919900, 'TELMAV'), - (2919926, 'pillarap'), - (2919959, 'pillarap'), - (2920007, 'pillarap'), - (2920106, 'pillarap'), - (2920205, 'pillarap'), - (2920304, 'pillarap'), - (2920403, 'pillarap'), - (2920452, 'TELMAV'), - (2920502, 'pillarap'), - (2920601, 'pillarap'), - (2920700, 'PATI'), - (2920809, 'pillarap'), - (2920908, 'PATI'), - (2921005, 'pillarap'), - (2921054, 'pillarap'), - (2921104, 'PATI'), - (2921203, 'pillarap'), - (2921302, 'pillarap'), - (2921401, 'pillarap'), - (2921450, 'pillarap'), - (2921500, 'RAFAHLS'), - (2921609, 'TELMAV'), - (2921708, 'pillarap'), - (2921807, 'pillarap'), - (2921906, 'pillarap'), - (2922003, 'PATI'), - (2922052, 'pillarap'), - (2922102, 'pillarap'), - (2922201, 'pillarap'), - (2922250, 'TELMAV'), - (2922300, 'pillarap'), - (2922409, 'pillarap'), - (2922508, 'pillarap'), - (2922607, 'PATI'), - (2922656, 'RAFAHLS'), - (2922706, 'pillarap'), - (2922730, 'RAFAHLS'), - (2922755, 'PATI'), - (2922805, 'pillarap'), - (2922854, 'pillarap'), - (2922904, 'RAFAHLS'), - (2923001, 'PATI'), - (2923035, 'pillarap'), - (2923050, 'RAFAHLS'), - (2923100, 'RAFAHLS'), - (2923209, 'pillarap'), - (2923308, 'pillarap'), - (2923357, 'pillarap'), - (2923407, 'pillarap'), - (2923506, 'pillarap'), - (2923605, 'pillarap'), - (2923704, 'TELMAV'), - (2923803, 'RAFAHLS'), - (2923902, 'PATI'), - (2924009, 'TELMAV'), - (2924058, 'RAFAHLS'), - (2924108, 'pillarap'), - (2924207, 'RAFAHLS'), - (2924306, 'pillarap'), - (2924405, 'TELMAV'), - (2924504, 'pillarap'), - (2924603, 'pillarap'), - (2924652, 'pillarap'), - (2924678, 'PATI'), - (2924702, 'pillarap'), - (2924801, 'pillarap'), - (2924900, 'pillarap'), - (2925006, 'pillarap'), - (2925105, 'pillarap'), - (2925204, 'pillarap'), - (2925253, 'pillarap'), - (2925303, 'PATI'), - (2925402, 'pillarap'), - (2925501, 'PATI'), - (2925600, 'pillarap'), - (2925709, 'pillarap'), - (2925758, 'PATI'), - (2925808, 'RAFAHLS'), - (2925907, 'RAFAHLS'), - (2925931, 'pillarap'), - (2925956, 'pillarap'), - (2926004, 'TELMAV'), - (2926103, 'RAFAHLS'), - (2926202, 'TELMAV'), - (2926301, 'RAFAHLS'), - (2926400, 'pillarap'), - (2926509, 'RAFAHLS'), - (2926608, 'RAFAHLS'), - (2926657, 'pillarap'), - (2926707, 'pillarap'), - (2926806, 'pillarap'), - (2926905, 'pillarap'), - (2927002, 'RAFAHLS'), - (2927101, 'TELMAV'), - (2927200, 'pillarap'), - (2927309, 'pillarap'), - (2927408, 'pillarap'), - (2927507, 'pillarap'), - (2927606, 'RAFAHLS'), - (2927705, 'PATI'), - (2927804, 'PATI'), - (2927903, 'pillarap'), - (2928059, 'PATI'), - (2928109, 'TELMAV'), - (2928406, 'TELMAV'), - (2928505, 'pillarap'), - (2928000, 'RAFAHLS'), - (2928208, 'TELMAV'), - (2928307, 'pillarap'), - (2928604, 'pillarap'), - (2928703, 'pillarap'), - (2928802, 'pillarap'), - (2928901, 'TELMAV'), - (2928950, 'RAFAHLS'), - (2929107, 'pillarap'), - (2929008, 'pillarap'), - (2929057, 'TELMAV'), - (2929206, 'pillarap'), - (2929255, 'pillarap'), - (2929305, 'pillarap'), - (2929354, 'PATI'), - (2929370, 'pillarap'), - (2929404, 'pillarap'), - (2929503, 'pillarap'), - (2929602, 'pillarap'), - (2929701, 'RAFAHLS'), - (2929750, 'pillarap'), - (2929800, 'pillarap'), - (2929909, 'pillarap'), - (2930006, 'pillarap'), - (2930105, 'pillarap'), - (2930204, 'TELMAV'), - (2930154, 'TELMAV'), - (2930303, 'TELMAV'), - (2930402, 'pillarap'), - (2930501, 'RAFAHLS'), - (2930600, 'pillarap'), - (2930709, 'pillarap'), - (2930758, 'TELMAV'), - (2930766, 'RAFAHLS'), - (2930774, 'TELMAV'), - (2930808, 'pillarap'), - (2930907, 'TELMAV'), - (2931004, 'pillarap'), - (2931053, 'pillarap'), - (2931103, 'pillarap'), - (2931202, 'PATI'), - (2931301, 'pillarap'), - (2931350, 'PATI'), - (2931400, 'pillarap'), - (2931509, 'RAFAHLS'), - (2931608, 'PATI'), - (2931707, 'pillarap'), - (2931806, 'pillarap'), - (2931905, 'RAFAHLS'), - (2932002, 'RAFAHLS'), - (2932101, 'pillarap'), - (2932200, 'PATI'), - (2932309, 'PATI'), - (2932408, 'pillarap'), - (2932457, 'pillarap'), - (2932507, 'PATI'), - (2932606, 'pillarap'), - (2932705, 'PATI'), - (2932804, 'pillarap'), - (2932903, 'PATI'), - (2933000, 'RAFAHLS'), - (2933059, 'pillarap'), - (2933109, 'pillarap'), - (2933158, 'pillarap'), - (2933174, 'pillarap'), - (2933208, 'pillarap'), - (2933257, 'PATI'), - (2933307, 'pillarap'), - (2933406, 'pillarap'), - (2933455, 'TELMAV'), - (2933505, 'PATI'), - (2933604, 'TELMAV'), - (3100104, 'robsoner'), - (3100203, 'BLUZ'), - (3100302, 'LFERNAN'), - (3100401, 'LFERNAN'), - (3100500, 'LILIANE'), - (3100609, 'LILIANE'), - (3100708, 'robsoner'), - (3100807, 'MARGARET'), - (3100906, 'TELMAV'), - (3101003, 'BLUZ'), - (3101102, 'LILIANE'), - (3101201, 'OTTO'), - (3101300, 'OTTO'), - (3101409, 'OTTO'), - (3101508, 'LFERNAN'), - (3101607, 'OTTO'), - (3101631, 'janarycn'), - (3101706, 'TELMAV'), - (3101805, 'LILIANE'), - (3101904, 'OTTO'), - (3102001, 'OTTO'), - (3102050, 'LFERNAN'), - (3153509, 'LFERNAN'), - (3102100, 'LFERNAN'), - (3102209, 'LILIANE'), - (3102308, 'MARGARET'), - (3102407, 'MARGARET'), - (3102506, 'LFERNAN'), - (3102605, 'OTTO'), - (3102803, 'OTTO'), - (3102852, 'TELMAV'), - (3102902, 'janarycn'), - (3103009, 'LILIANE'), - (3103108, 'LFERNAN'), - (3103207, 'MARGARET'), - (3103306, 'LFERNAN'), - (3103405, 'TELMAV'), - (3103504, 'robsoner'), - (3103603, 'OTTO'), - (3103702, 'LFERNAN'), - (3103751, 'robsoner'), - (3103801, 'robsoner'), - (3103900, 'BLUZ'), - (3104007, 'robsoner'), - (3104106, 'OTTO'), - (3104205, 'MARGARET'), - (3104304, 'OTTO'), - (3104403, 'LFERNAN'), - (3104452, 'TELMAV'), - (3104502, 'robsoner'), - (3104601, 'LFERNAN'), - (3104700, 'TELMAV'), - (3104809, 'BLUZ'), - (3104908, 'OTTO'), - (3105004, 'MARGARET'), - (3105103, 'MARGARET'), - (3105202, 'TELMAV'), - (3105301, 'OTTO'), - (3105400, 'MARGARET'), - (3105509, 'LFERNAN'), - (3105608, 'janarycn'), - (3105707, 'LFERNAN'), - (3105905, 'janarycn'), - (3106002, 'MARGARET'), - (3106101, 'LFERNAN'), - (3106200, 'MARGARET'), - (3106309, 'LILIANE'), - (3106408, 'MARGARET'), - (3106507, 'TELMAV'), - (3106655, 'BLUZ'), - (3106606, 'TELMAV'), - (3106705, 'MARGARET'), - (3106804, 'LFERNAN'), - (3106903, 'LFERNAN'), - (3107000, 'BLUZ'), - (3107109, 'OTTO'), - (3107208, 'OTTO'), - (3107307, 'BLUZ'), - (3107406, 'BLUZ'), - (3107505, 'OTTO'), - (3107604, 'OTTO'), - (3107703, 'MARGARET'), - (3107802, 'LILIANE'), - (3107901, 'OTTO'), - (3108008, 'MARGARET'), - (3108107, 'MARGARET'), - (3108206, 'robsoner'), - (3108255, 'BLUZ'), - (3108305, 'OTTO'), - (3108404, 'OTTO'), - (3108503, 'BLUZ'), - (3108701, 'LFERNAN'), - (3108552, 'robsoner'), - (3108602, 'BLUZ'), - (3108800, 'LILIANE'), - (3108909, 'OTTO'), - (3109006, 'MARGARET'), - (3109105, 'OTTO'), - (3109204, 'BLUZ'), - (3109253, 'LILIANE'), - (3109303, 'robsoner'), - (3109402, 'BLUZ'), - (3109451, 'robsoner'), - (3109501, 'OTTO'), - (3109600, 'MARGARET'), - (3109709, 'OTTO'), - (3102704, 'TELMAV'), - (3109808, 'robsoner'), - (3109907, 'MARGARET'), - (3110004, 'MARGARET'), - (3110103, 'LFERNAN'), - (3110202, 'LFERNAN'), - (3110301, 'OTTO'), - (3110400, 'MARGARET'), - (3110509, 'OTTO'), - (3110608, 'OTTO'), - (3110707, 'OTTO'), - (3110806, 'LILIANE'), - (3110905, 'OTTO'), - (3111002, 'OTTO'), - (3111101, 'robsoner'), - (3111150, 'BLUZ'), - (3111200, 'MARGARET'), - (3111309, 'OTTO'), - (3111408, 'robsoner'), - (3111507, 'robsoner'), - (3111606, 'OTTO'), - (3111903, 'MARGARET'), - (3111705, 'LFERNAN'), - (3111804, 'robsoner'), - (3112000, 'MARGARET'), - (3112059, 'LILIANE'), - (3112109, 'LFERNAN'), - (3112208, 'janarycn'), - (3112307, 'TELMAV'), - (3112406, 'OTTO'), - (3112505, 'MARGARET'), - (3112604, 'robsoner'), - (3112653, 'LILIANE'), - (3112703, 'BLUZ'), - (3112802, 'OTTO'), - (3112901, 'LFERNAN'), - (3113008, 'TELMAV'), - (3113107, 'janarycn'), - (3113206, 'janarycn'), - (3113305, 'LFERNAN'), - (3113404, 'LILIANE'), - (3113503, 'TELMAV'), - (3113602, 'OTTO'), - (3113701, 'TELMAV'), - (3113800, 'LILIANE'), - (3113909, 'OTTO'), - (3114006, 'MARGARET'), - (3114105, 'OTTO'), - (3114204, 'MARGARET'), - (3114303, 'robsoner'), - (3114402, 'OTTO'), - (3114501, 'MARGARET'), - (3114550, 'robsoner'), - (3114600, 'janarycn'), - (3114709, 'OTTO'), - (3114808, 'OTTO'), - (3114907, 'MARGARET'), - (3115003, 'robsoner'), - (3115102, 'OTTO'), - (3115300, 'LFERNAN'), - (3115359, 'MARGARET'), - (3115409, 'MARGARET'), - (3115458, 'TELMAV'), - (3115474, 'BLUZ'), - (3115508, 'OTTO'), - (3115607, 'BLUZ'), - (3115706, 'LILIANE'), - (3115805, 'robsoner'), - (3115904, 'LFERNAN'), - (3116001, 'LFERNAN'), - (3116100, 'TELMAV'), - (3116159, 'BLUZ'), - (3116209, 'LFERNAN'), - (3116308, 'LFERNAN'), - (3116407, 'OTTO'), - (3116506, 'BLUZ'), - (3116605, 'MARGARET'), - (3116704, 'LFERNAN'), - (3116803, 'LILIANE'), - (3116902, 'robsoner'), - (3117009, 'TELMAV'), - (3117108, 'OTTO'), - (3115201, 'janarycn'), - (3117306, 'robsoner'), - (3117207, 'OTTO'), - (3117405, 'LILIANE'), - (3117504, 'MARGARET'), - (3117603, 'MARGARET'), - (3117702, 'OTTO'), - (3117801, 'OTTO'), - (3117836, 'BLUZ'), - (3117876, 'MARGARET'), - (3117900, 'OTTO'), - (3118007, 'MARGARET'), - (3118106, 'MARGARET'), - (3118205, 'robsoner'), - (3118304, 'MARGARET'), - (3118403, 'LILIANE'), - (3118502, 'OTTO'), - (3118601, 'MARGARET'), - (3118700, 'OTTO'), - (3118809, 'BLUZ'), - (3118908, 'MARGARET'), - (3119005, 'OTTO'), - (3119104, 'BLUZ'), - (3119203, 'LILIANE'), - (3119302, 'robsoner'), - (3119401, 'LILIANE'), - (3119500, 'TELMAV'), - (3119609, 'LFERNAN'), - (3119708, 'janarycn'), - (3119807, 'MARGARET'), - (3119906, 'OTTO'), - (3119955, 'MARGARET'), - (3120003, 'LILIANE'), - (3120102, 'TELMAV'), - (3120151, 'TELMAV'), - (3120201, 'MARGARET'), - (3120300, 'BLUZ'), - (3120409, 'MARGARET'), - (3120508, 'OTTO'), - (3120607, 'MARGARET'), - (3120706, 'robsoner'), - (3120805, 'OTTO'), - (3120839, 'LILIANE'), - (3120870, 'BLUZ'), - (3120904, 'BLUZ'), - (3121001, 'TELMAV'), - (3121100, 'OTTO'), - (3121209, 'OTTO'), - (3121258, 'robsoner'), - (3121308, 'LFERNAN'), - (3121407, 'MARGARET'), - (3121506, 'janarycn'), - (3121605, 'TELMAV'), - (3121704, 'MARGARET'), - (3121803, 'MARGARET'), - (3121902, 'LFERNAN'), - (3122009, 'LFERNAN'), - (3122108, 'LILIANE'), - (3122207, 'LILIANE'), - (3122306, 'MARGARET'), - (3122355, 'BLUZ'), - (3122405, 'OTTO'), - (3122454, 'TELMAV'), - (3122470, 'robsoner'), - (3122504, 'LILIANE'), - (3122603, 'MARGARET'), - (3122702, 'LFERNAN'), - (3122801, 'OTTO'), - (3122900, 'LFERNAN'), - (3123007, 'janarycn'), - (3123106, 'LILIANE'), - (3123205, 'BLUZ'), - (3123304, 'LFERNAN'), - (3123403, 'MARGARET'), - (3123502, 'robsoner'), - (3123528, 'LFERNAN'), - (3123601, 'OTTO'), - (3123700, 'LILIANE'), - (3123809, 'BLUZ'), - (3123858, 'LILIANE'), - (3123908, 'MARGARET'), - (3124005, 'LFERNAN'), - (3124104, 'MARGARET'), - (3124203, 'LFERNAN'), - (3124302, 'BLUZ'), - (3124401, 'OTTO'), - (3124500, 'OTTO'), - (3124609, 'LFERNAN'), - (3124708, 'BLUZ'), - (3124807, 'robsoner'), - (3124906, 'LFERNAN'), - (3125002, 'LFERNAN'), - (3125101, 'OTTO'), - (3125200, 'OTTO'), - (3125309, 'LFERNAN'), - (3125408, 'TELMAV'), - (3125606, 'TELMAV'), - (3125705, 'BLUZ'), - (3125804, 'LILIANE'), - (3125903, 'MARGARET'), - (3125952, 'LFERNAN'), - (3126000, 'MARGARET'), - (3126109, 'MARGARET'), - (3126208, 'robsoner'), - (3126307, 'OTTO'), - (3126406, 'MARGARET'), - (3126505, 'TELMAV'), - (3126604, 'BLUZ'), - (3126703, 'BLUZ'), - (3126752, 'TELMAV'), - (3126802, 'TELMAV'), - (3126901, 'LILIANE'), - (3126950, 'LILIANE'), - (3127008, 'robsoner'), - (3127057, 'TELMAV'), - (3127073, 'BLUZ'), - (3127107, 'robsoner'), - (3127206, 'MARGARET'), - (3127305, 'LILIANE'), - (3127339, 'BLUZ'), - (3127354, 'BLUZ'), - (3127370, 'LILIANE'), - (3127388, 'LFERNAN'), - (3127404, 'OTTO'), - (3127503, 'LILIANE'), - (3127602, 'TELMAV'), - (3127701, 'LILIANE'), - (3127800, 'BLUZ'), - (3127909, 'robsoner'), - (3128006, 'LILIANE'), - (3128105, 'OTTO'), - (3128204, 'LFERNAN'), - (3128253, 'BLUZ'), - (3128303, 'OTTO'), - (3128402, 'LFERNAN'), - (3128501, 'LFERNAN'), - (3128600, 'robsoner'), - (3128709, 'OTTO'), - (3128808, 'LFERNAN'), - (3128907, 'robsoner'), - (3129004, 'LFERNAN'), - (3129103, 'robsoner'), - (3129202, 'OTTO'), - (3129301, 'LILIANE'), - (3129400, 'janarycn'), - (3129509, 'robsoner'), - (3129608, 'BLUZ'), - (3129657, 'BLUZ'), - (3129707, 'OTTO'), - (3129806, 'MARGARET'), - (3129905, 'OTTO'), - (3130002, 'MARGARET'), - (3130051, 'BLUZ'), - (3130101, 'MARGARET'), - (3130200, 'MARGARET'), - (3130309, 'MARGARET'), - (3130408, 'janarycn'), - (3130507, 'OTTO'), - (3130556, 'LILIANE'), - (3130606, 'OTTO'), - (3130655, 'BLUZ'), - (3130705, 'robsoner'), - (3130804, 'janarycn'), - (3130903, 'LILIANE'), - (3131000, 'MARGARET'), - (3131109, 'BLUZ'), - (3131158, 'LILIANE'), - (3131208, 'LILIANE'), - (3131307, 'LILIANE'), - (3131406, 'robsoner'), - (3131505, 'OTTO'), - (3131604, 'robsoner'), - (3131703, 'MARGARET'), - (3131802, 'LILIANE'), - (3131901, 'MARGARET'), - (3132008, 'BLUZ'), - (3132107, 'BLUZ'), - (3132206, 'MARGARET'), - (3132305, 'TELMAV'), - (3132404, 'OTTO'), - (3132503, 'TELMAV'), - (3132602, 'LFERNAN'), - (3132701, 'LILIANE'), - (3132800, 'MARGARET'), - (3132909, 'OTTO'), - (3133006, 'OTTO'), - (3133105, 'OTTO'), - (3133204, 'LILIANE'), - (3133303, 'TELMAV'), - (3133402, 'robsoner'), - (3133501, 'MARGARET'), - (3133600, 'OTTO'), - (3133709, 'MARGARET'), - (3133758, 'OTTO'), - (3133808, 'MARGARET'), - (3133907, 'MARGARET'), - (3134004, 'TELMAV'), - (3134103, 'LILIANE'), - (3134202, 'robsoner'), - (3134301, 'janarycn'), - (3134400, 'robsoner'), - (3134509, 'janarycn'), - (3134608, 'MARGARET'), - (3134707, 'TELMAV'), - (3134806, 'OTTO'), - (3134905, 'OTTO'), - (3135001, 'LILIANE'), - (3135050, 'BLUZ'), - (3135076, 'LILIANE'), - (3135100, 'BLUZ'), - (3135209, 'BLUZ'), - (3135308, 'BLUZ'), - (3135357, 'BLUZ'), - (3135407, 'MARGARET'), - (3135456, 'TELMAV'), - (3135506, 'LFERNAN'), - (3135605, 'BLUZ'), - (3135704, 'MARGARET'), - (3135803, 'TELMAV'), - (3135902, 'OTTO'), - (3136009, 'TELMAV'), - (3136108, 'LILIANE'), - (3136207, 'MARGARET'), - (3136306, 'robsoner'), - (3136405, 'BLUZ'), - (3136504, 'TELMAV'), - (3136520, 'TELMAV'), - (3136553, 'LILIANE'), - (3136579, 'BLUZ'), - (3136652, 'MARGARET'), - (3136702, 'LFERNAN'), - (3136801, 'BLUZ'), - (3136900, 'OTTO'), - (3136959, 'BLUZ'), - (3137007, 'TELMAV'), - (3137106, 'robsoner'), - (3137205, 'BLUZ'), - (3137304, 'BLUZ'), - (3137403, 'janarycn'), - (3137502, 'robsoner'), - (3137536, 'robsoner'), - (3137601, 'MARGARET'), - (3137700, 'LFERNAN'), - (3137809, 'OTTO'), - (3137908, 'LFERNAN'), - (3138005, 'LFERNAN'), - (3138104, 'BLUZ'), - (3138203, 'janarycn'), - (3138302, 'BLUZ'), - (3138351, 'TELMAV'), - (3138401, 'LFERNAN'), - (3138500, 'OTTO'), - (3138609, 'LFERNAN'), - (3138625, 'robsoner'), - (3138658, 'BLUZ'), - (3138674, 'LFERNAN'), - (3138682, 'BLUZ'), - (3138708, 'janarycn'), - (3138807, 'BLUZ'), - (3138906, 'TELMAV'), - (3139003, 'OTTO'), - (3139102, 'janarycn'), - (3139201, 'TELMAV'), - (3139250, 'BLUZ'), - (3139300, 'BLUZ'), - (3139409, 'LFERNAN'), - (3139508, 'LFERNAN'), - (3139607, 'LILIANE'), - (3139805, 'LFERNAN'), - (3139706, 'MARGARET'), - (3139904, 'OTTO'), - (3140001, 'MARGARET'), - (3140100, 'LILIANE'), - (3140159, 'MARGARET'), - (3140209, 'LFERNAN'), - (3140308, 'LILIANE'), - (3140407, 'OTTO'), - (3140506, 'BLUZ'), - (3140530, 'LFERNAN'), - (3140555, 'TELMAV'), - (3140605, 'LILIANE'), - (3140704, 'MARGARET'), - (3171501, 'LILIANE'), - (3140803, 'LFERNAN'), - (3140852, 'BLUZ'), - (3140902, 'LFERNAN'), - (3141009, 'BLUZ'), - (3141108, 'MARGARET'), - (3141207, 'robsoner'), - (3141306, 'MARGARET'), - (3141405, 'TELMAV'), - (3141504, 'LILIANE'), - (3141603, 'LFERNAN'), - (3141702, 'LILIANE'), - (3141801, 'TELMAV'), - (3141900, 'OTTO'), - (3142007, 'BLUZ'), - (3142106, 'LFERNAN'), - (3142205, 'LFERNAN'), - (3142254, 'BLUZ'), - (3142304, 'MARGARET'), - (3142403, 'BLUZ'), - (3142502, 'BLUZ'), - (3142601, 'OTTO'), - (3142700, 'BLUZ'), - (3142809, 'robsoner'), - (3142908, 'BLUZ'), - (3143005, 'OTTO'), - (3143104, 'robsoner'), - (3143153, 'TELMAV'), - (3143203, 'OTTO'), - (3143401, 'OTTO'), - (3143302, 'BLUZ'), - (3143450, 'BLUZ'), - (3143500, 'BLUZ'), - (3143609, 'BLUZ'), - (3143708, 'MARGARET'), - (3143807, 'OTTO'), - (3143906, 'LFERNAN'), - (3144003, 'LILIANE'), - (3144102, 'OTTO'), - (3144201, 'LILIANE'), - (3144300, 'TELMAV'), - (3144359, 'LILIANE'), - (3144375, 'robsoner'), - (3144409, 'OTTO'), - (3144508, 'janarycn'), - (3144607, 'janarycn'), - (3144656, 'BLUZ'), - (3144672, 'LILIANE'), - (3144706, 'MARGARET'), - (3144805, 'MARGARET'), - (3144904, 'LILIANE'), - (3145000, 'robsoner'), - (3145059, 'BLUZ'), - (3145109, 'OTTO'), - (3145208, 'MARGARET'), - (3136603, 'MARGARET'), - (3145307, 'TELMAV'), - (3145356, 'TELMAV'), - (3145372, 'BLUZ'), - (3145406, 'LFERNAN'), - (3145455, 'BLUZ'), - (3145505, 'OTTO'), - (3145604, 'MARGARET'), - (3145703, 'LFERNAN'), - (3145802, 'MARGARET'), - (3145851, 'LFERNAN'), - (3145877, 'LFERNAN'), - (3145901, 'MARGARET'), - (3146008, 'OTTO'), - (3146107, 'MARGARET'), - (3146206, 'TELMAV'), - (3146255, 'BLUZ'), - (3146305, 'TELMAV'), - (3146552, 'BLUZ'), - (3146404, 'BLUZ'), - (3146503, 'MARGARET'), - (3146602, 'LFERNAN'), - (3146701, 'LFERNAN'), - (3146750, 'TELMAV'), - (3146909, 'MARGARET'), - (3147105, 'MARGARET'), - (3147006, 'robsoner'), - (3147204, 'OTTO'), - (3147303, 'OTTO'), - (3147402, 'MARGARET'), - (3147600, 'OTTO'), - (3147709, 'MARGARET'), - (3147501, 'MARGARET'), - (3147808, 'OTTO'), - (3147907, 'OTTO'), - (3147956, 'BLUZ'), - (3148004, 'robsoner'), - (3148103, 'robsoner'), - (3148202, 'LFERNAN'), - (3148301, 'LFERNAN'), - (3148400, 'LILIANE'), - (3148509, 'TELMAV'), - (3148608, 'LILIANE'), - (3148707, 'TELMAV'), - (3148756, 'LFERNAN'), - (3148806, 'LFERNAN'), - (3148905, 'MARGARET'), - (3149002, 'LFERNAN'), - (3149101, 'OTTO'), - (3149150, 'BLUZ'), - (3149200, 'robsoner'), - (3149309, 'MARGARET'), - (3149408, 'LFERNAN'), - (3149507, 'LFERNAN'), - (3149606, 'MARGARET'), - (3149705, 'MARGARET'), - (3149804, 'robsoner'), - (3149903, 'MARGARET'), - (3149952, 'LILIANE'), - (3150000, 'LILIANE'), - (3150109, 'LFERNAN'), - (3150158, 'LILIANE'), - (3150208, 'LFERNAN'), - (3150307, 'janarycn'), - (3150406, 'MARGARET'), - (3150505, 'MARGARET'), - (3150539, 'LILIANE'), - (3150570, 'BLUZ'), - (3150604, 'MARGARET'), - (3150703, 'robsoner'), - (3150802, 'LFERNAN'), - (3150901, 'OTTO'), - (3151008, 'OTTO'), - (3151107, 'LFERNAN'), - (3151206, 'BLUZ'), - (3151305, 'LFERNAN'), - (3151404, 'MARGARET'), - (3151503, 'MARGARET'), - (3151602, 'robsoner'), - (3151701, 'OTTO'), - (3151800, 'OTTO'), - (3151909, 'LILIANE'), - (3152006, 'BLUZ'), - (3152105, 'LFERNAN'), - (3152131, 'BLUZ'), - (3152170, 'TELMAV'), - (3152204, 'BLUZ'), - (3152303, 'LFERNAN'), - (3152402, 'TELMAV'), - (3152501, 'OTTO'), - (3152600, 'OTTO'), - (3152709, 'janarycn'), - (3152808, 'robsoner'), - (3152907, 'OTTO'), - (3153004, 'robsoner'), - (3153103, 'LFERNAN'), - (3153202, 'BLUZ'), - (3153301, 'TELMAV'), - (3153400, 'robsoner'), - (3153608, 'MARGARET'), - (3153707, 'BLUZ'), - (3153806, 'MARGARET'), - (3153905, 'MARGARET'), - (3154002, 'LFERNAN'), - (3154101, 'LFERNAN'), - (3154150, 'LFERNAN'), - (3154200, 'janarycn'), - (3154309, 'LILIANE'), - (3154408, 'janarycn'), - (3154457, 'BLUZ'), - (3154507, 'BLUZ'), - (3154606, 'MARGARET'), - (3154705, 'janarycn'), - (3154804, 'MARGARET'), - (3154903, 'LFERNAN'), - (3155108, 'TELMAV'), - (3155009, 'LFERNAN'), - (3155207, 'LFERNAN'), - (3155306, 'MARGARET'), - (3155405, 'LFERNAN'), - (3155504, 'robsoner'), - (3155603, 'BLUZ'), - (3155702, 'MARGARET'), - (3155801, 'LFERNAN'), - (3155900, 'LFERNAN'), - (3156007, 'MARGARET'), - (3156106, 'janarycn'), - (3156205, 'LFERNAN'), - (3156304, 'LFERNAN'), - (3156403, 'robsoner'), - (3156452, 'LFERNAN'), - (3156502, 'BLUZ'), - (3156601, 'TELMAV'), - (3156700, 'MARGARET'), - (3156809, 'LILIANE'), - (3156908, 'robsoner'), - (3157005, 'BLUZ'), - (3157104, 'TELMAV'), - (3157203, 'MARGARET'), - (3157252, 'LILIANE'), - (3157278, 'LFERNAN'), - (3157302, 'janarycn'), - (3157336, 'janarycn'), - (3157377, 'BLUZ'), - (3157401, 'LFERNAN'), - (3157500, 'LILIANE'), - (3157609, 'BLUZ'), - (3157658, 'TELMAV'), - (3157708, 'robsoner'), - (3157807, 'MARGARET'), - (3157906, 'LFERNAN'), - (3158003, 'MARGARET'), - (3158102, 'TELMAV'), - (3158201, 'LILIANE'), - (3159209, 'OTTO'), - (3159407, 'LFERNAN'), - (3159308, 'LFERNAN'), - (3159357, 'LILIANE'), - (3159506, 'LILIANE'), - (3159605, 'OTTO'), - (3159704, 'robsoner'), - (3159803, 'robsoner'), - (3158300, 'OTTO'), - (3158409, 'LFERNAN'), - (3158508, 'MARGARET'), - (3158607, 'LFERNAN'), - (3158706, 'janarycn'), - (3158805, 'MARGARET'), - (3158904, 'LFERNAN'), - (3158953, 'LILIANE'), - (3159001, 'MARGARET'), - (3159100, 'MARGARET'), - (3159902, 'MARGARET'), - (3160009, 'LFERNAN'), - (3160108, 'LFERNAN'), - (3160207, 'MARGARET'), - (3160306, 'TELMAV'), - (3160405, 'MARGARET'), - (3160454, 'BLUZ'), - (3160504, 'MARGARET'), - (3160603, 'BLUZ'), - (3160702, 'LFERNAN'), - (3160801, 'OTTO'), - (3160900, 'MARGARET'), - (3160959, 'LILIANE'), - (3161007, 'MARGARET'), - (3161056, 'LILIANE'), - (3161106, 'BLUZ'), - (3161205, 'MARGARET'), - (3161304, 'robsoner'), - (3161403, 'LFERNAN'), - (3161502, 'LFERNAN'), - (3161601, 'LILIANE'), - (3161650, 'LILIANE'), - (3161700, 'robsoner'), - (3161809, 'MARGARET'), - (3161908, 'MARGARET'), - (3125507, 'TELMAV'), - (3162005, 'OTTO'), - (3162104, 'robsoner'), - (3162203, 'OTTO'), - (3162252, 'BLUZ'), - (3162302, 'OTTO'), - (3162401, 'BLUZ'), - (3162450, 'BLUZ'), - (3162500, 'janarycn'), - (3162559, 'LFERNAN'), - (3162575, 'LILIANE'), - (3162609, 'LILIANE'), - (3162658, 'BLUZ'), - (3162708, 'BLUZ'), - (3162807, 'LILIANE'), - (3162906, 'LFERNAN'), - (3162922, 'MARGARET'), - (3162948, 'OTTO'), - (3162955, 'MARGARET'), - (3163003, 'LILIANE'), - (3163102, 'MARGARET'), - (3163201, 'OTTO'), - (3163300, 'LILIANE'), - (3163409, 'MARGARET'), - (3163508, 'LILIANE'), - (3163607, 'LFERNAN'), - (3163706, 'OTTO'), - (3163805, 'LFERNAN'), - (3163904, 'OTTO'), - (3164100, 'LILIANE'), - (3164001, 'LFERNAN'), - (3164209, 'BLUZ'), - (3164308, 'MARGARET'), - (3164407, 'OTTO'), - (3164431, 'LFERNAN'), - (3164472, 'LILIANE'), - (3164506, 'LILIANE'), - (3164605, 'MARGARET'), - (3164704, 'OTTO'), - (3164803, 'MARGARET'), - (3164902, 'OTTO'), - (3165206, 'OTTO'), - (3165008, 'janarycn'), - (3165107, 'OTTO'), - (3165305, 'OTTO'), - (3165404, 'OTTO'), - (3165503, 'LILIANE'), - (3165537, 'MARGARET'), - (3165560, 'LFERNAN'), - (3165578, 'OTTO'), - (3165602, 'LFERNAN'), - (3165701, 'LFERNAN'), - (3165800, 'OTTO'), - (3165909, 'TELMAV'), - (3166006, 'LFERNAN'), - (3166105, 'LILIANE'), - (3166204, 'janarycn'), - (3166303, 'LFERNAN'), - (3166402, 'OTTO'), - (3166501, 'MARGARET'), - (3166600, 'BLUZ'), - (3166808, 'robsoner'), - (3166709, 'TELMAV'), - (3166907, 'OTTO'), - (3166956, 'BLUZ'), - (3167004, 'OTTO'), - (3167103, 'MARGARET'), - (3167202, 'MARGARET'), - (3165552, 'TELMAV'), - (3167301, 'LFERNAN'), - (3167400, 'OTTO'), - (3167509, 'LFERNAN'), - (3167608, 'LFERNAN'), - (3167707, 'LILIANE'), - (3167806, 'OTTO'), - (3167905, 'LFERNAN'), - (3168002, 'BLUZ'), - (3168051, 'LILIANE'), - (3168101, 'robsoner'), - (3168200, 'MARGARET'), - (3168309, 'MARGARET'), - (3168408, 'LILIANE'), - (3168507, 'LFERNAN'), - (3168606, 'TELMAV'), - (3168705, 'LILIANE'), - (3168804, 'janarycn'), - (3168903, 'robsoner'), - (3169000, 'LFERNAN'), - (3169059, 'OTTO'), - (3169109, 'OTTO'), - (3169208, 'LFERNAN'), - (3169307, 'OTTO'), - (3169356, 'BLUZ'), - (3169406, 'OTTO'), - (3169505, 'LILIANE'), - (3169604, 'robsoner'), - (3169703, 'TELMAV'), - (3169802, 'OTTO'), - (3169901, 'LFERNAN'), - (3170008, 'BLUZ'), - (3170057, 'LILIANE'), - (3170107, 'robsoner'), - (3170206, 'robsoner'), - (3170305, 'TELMAV'), - (3170404, 'robsoner'), - (3170438, 'robsoner'), - (3170479, 'robsoner'), - (3170503, 'LFERNAN'), - (3170529, 'BLUZ'), - (3170578, 'LILIANE'), - (3170602, 'MARGARET'), - (3170651, 'BLUZ'), - (3170701, 'OTTO'), - (3170750, 'robsoner'), - (3170800, 'BLUZ'), - (3170909, 'BLUZ'), - (3171006, 'robsoner'), - (3171030, 'BLUZ'), - (3171071, 'TELMAV'), - (3171105, 'robsoner'), - (3171154, 'LFERNAN'), - (3171204, 'MARGARET'), - (3171303, 'LFERNAN'), - (3171402, 'LFERNAN'), - (3171600, 'TELMAV'), - (3171709, 'OTTO'), - (3171808, 'LILIANE'), - (3171907, 'LILIANE'), - (3172004, 'LFERNAN'), - (3172103, 'LFERNAN'), - (3172202, 'OTTO'), - (3200102, 'OTTO'), - (3200169, 'JBGOIS'), - (3200136, 'JBGOIS'), - (3200201, 'JBGOIS'), - (3200300, 'OTTO'), - (3200359, 'JBGOIS'), - (3200409, 'OTTO'), - (3200508, 'JBGOIS'), - (3200607, 'ADAL'), - (3200706, 'JBGOIS'), - (3200805, 'JBGOIS'), - (3200904, 'JBGOIS'), - (3201001, 'JBGOIS'), - (3201100, 'JBGOIS'), - (3201159, 'OTTO'), - (3201209, 'JBGOIS'), - (3201308, 'OTTO'), - (3201407, 'JBGOIS'), - (3201506, 'JBGOIS'), - (3201605, 'ADAL'), - (3201704, 'OTTO'), - (3201803, 'JBGOIS'), - (3201902, 'OTTO'), - (3202009, 'JBGOIS'), - (3202108, 'JBGOIS'), - (3202207, 'ADAL'), - (3202256, 'JBGOIS'), - (3202306, 'JBGOIS'), - (3202405, 'OTTO'), - (3202454, 'JBGOIS'), - (3202504, 'ADAL'), - (3202553, 'JBGOIS'), - (3202603, 'OTTO'), - (3202652, 'JBGOIS'), - (3202702, 'OTTO'), - (3202801, 'JBGOIS'), - (3202900, 'OTTO'), - (3203007, 'JBGOIS'), - (3203056, 'ADAL'), - (3203106, 'JBGOIS'), - (3203130, 'ADAL'), - (3203163, 'OTTO'), - (3203205, 'ADAL'), - (3203304, 'JBGOIS'), - (3203320, 'JBGOIS'), - (3203346, 'OTTO'), - (3203353, 'JBGOIS'), - (3203403, 'JBGOIS'), - (3203502, 'ADAL'), - (3203601, 'ADAL'), - (3203700, 'JBGOIS'), - (3203809, 'JBGOIS'), - (3203908, 'JBGOIS'), - (3204005, 'JBGOIS'), - (3204054, 'ADAL'), - (3204104, 'ADAL'), - (3204203, 'OTTO'), - (3204252, 'ADAL'), - (3204302, 'JBGOIS'), - (3204351, 'ADAL'), - (3204401, 'OTTO'), - (3204500, 'OTTO'), - (3204559, 'OTTO'), - (3204609, 'OTTO'), - (3204658, 'JBGOIS'), - (3204708, 'JBGOIS'), - (3204807, 'JBGOIS'), - (3204906, 'ADAL'), - (3204955, 'OTTO'), - (3205002, 'OTTO'), - (3205010, 'ADAL'), - (3205036, 'JBGOIS'), - (3205069, 'OTTO'), - (3205101, 'OTTO'), - (3205150, 'JBGOIS'), - (3205176, 'JBGOIS'), - (3205200, 'OTTO'), - (3205309, 'OTTO'), - (3300100, 'PATI'), - (3300159, 'pillarap'), - (3300209, 'pillarap'), - (3300225, 'MARGARET'), - (3300233, 'pillarap'), - (3300258, 'pillarap'), - (3300308, 'PATI'), - (3300407, 'PATI'), - (3300456, 'LFERNAN'), - (3300506, 'MARGARET'), - (3300605, 'pillarap'), - (3300704, 'pillarap'), - (3300803, 'LFERNAN'), - (3300902, 'pillarap'), - (3301009, 'pillarap'), - (3301108, 'MARGARET'), - (3300936, 'pillarap'), - (3301157, 'pillarap'), - (3301207, 'MARGARET'), - (3301306, 'pillarap'), - (3300951, 'MARGARET'), - (3301405, 'pillarap'), - (3301504, 'MARGARET'), - (3301603, 'MARGARET'), - (3301702, 'LFERNAN'), - (3301801, 'LFERNAN'), - (3301850, 'LFERNAN'), - (3301876, 'pillarap'), - (3301900, 'LFERNAN'), - (3302007, 'LFERNAN'), - (3302056, 'pillarap'), - (3302106, 'pillarap'), - (3302205, 'pillarap'), - (3302254, 'PATI'), - (3302270, 'LFERNAN'), - (3302304, 'pillarap'), - (3302403, 'pillarap'), - (3302452, 'MARGARET'), - (3302502, 'LFERNAN'), - (3302601, 'LFERNAN'), - (3302700, 'LFERNAN'), - (3302809, 'LFERNAN'), - (3302858, 'LFERNAN'), - (3302908, 'LFERNAN'), - (3303005, 'pillarap'), - (3303104, 'pillarap'), - (3303203, 'LFERNAN'), - (3303302, 'LFERNAN'), - (3303401, 'MARGARET'), - (3303500, 'LFERNAN'), - (3303609, 'LFERNAN'), - (3303708, 'MARGARET'), - (3303807, 'PATI'), - (3303856, 'LFERNAN'), - (3303906, 'LFERNAN'), - (3303955, 'PATI'), - (3304003, 'PATI'), - (3304102, 'pillarap'), - (3304110, 'PATI'), - (3304128, 'PATI'), - (3304144, 'LFERNAN'), - (3304151, 'pillarap'), - (3304201, 'PATI'), - (3304300, 'LFERNAN'), - (3304409, 'PATI'), - (3304508, 'PATI'), - (3304524, 'pillarap'), - (3304557, 'LFERNAN'), - (3304607, 'MARGARET'), - (3304706, 'pillarap'), - (3304805, 'pillarap'), - (3304755, 'pillarap'), - (3304904, 'LFERNAN'), - (3305000, 'pillarap'), - (3305109, 'LFERNAN'), - (3305133, 'pillarap'), - (3305158, 'LFERNAN'), - (3305208, 'pillarap'), - (3305307, 'MARGARET'), - (3305406, 'MARGARET'), - (3305505, 'pillarap'), - (3305554, 'LFERNAN'), - (3305604, 'pillarap'), - (3305703, 'MARGARET'), - (3305752, 'LFERNAN'), - (3305802, 'LFERNAN'), - (3305901, 'MARGARET'), - (3306008, 'MARGARET'), - (3306107, 'PATI'), - (3306156, 'pillarap'), - (3306206, 'LFERNAN'), - (3306305, 'PATI'), - (3500105, 'BLUZ'), - (3500204, 'robsoner'), - (3500303, 'RAFAHLS'), - (3500402, 'RAFAHLS'), - (3500501, 'RAFAHLS'), - (3500550, 'TELMAV'), - (3500600, 'RONALDL'), - (3500709, 'TELMAV'), - (3500758, 'OTTO'), - (3500808, 'BLUZ'), - (3500907, 'robsoner'), - (3501004, 'robsoner'), - (3501103, 'BLUZ'), - (3501152, 'RAFAHLS'), - (3501202, 'robsoner'), - (3501301, 'BLUZ'), - (3501400, 'BLUZ'), - (3501509, 'BLUZ'), - (3501608, 'RAFAHLS'), - (3501707, 'RONALDL'), - (3501806, 'robsoner'), - (3501905, 'RAFAHLS'), - (3502002, 'RONALDL'), - (3502101, 'BLUZ'), - (3502200, 'OTTO'), - (3502309, 'TELMAV'), - (3502408, 'BLUZ'), - (3502507, 'RAFAHLS'), - (3502606, 'robsoner'), - (3502705, 'OTTO'), - (3502754, 'RAFAHLS'), - (3502804, 'BLUZ'), - (3502903, 'RAFAHLS'), - (3503000, 'robsoner'), - (3503109, 'TELMAV'), - (3503158, 'RAFAHLS'), - (3503208, 'RONALDL'), - (3503307, 'RONALDL'), - (3503356, 'BLUZ'), - (3503406, 'TELMAV'), - (3503505, 'RAFAHLS'), - (3503604, 'TELMAV'), - (3503703, 'robsoner'), - (3503802, 'RAFAHLS'), - (3503901, 'OTTO'), - (3503950, 'robsoner'), - (3504008, 'TELMAV'), - (3504107, 'RAFAHLS'), - (3504206, 'robsoner'), - (3504305, 'TELMAV'), - (3504404, 'BLUZ'), - (3504503, 'TELMAV'), - (3504602, 'robsoner'), - (3504701, 'TELMAV'), - (3504800, 'robsoner'), - (3504909, 'RAFAHLS'), - (3505005, 'OTTO'), - (3505104, 'BLUZ'), - (3505203, 'TELMAV'), - (3505302, 'TELMAV'), - (3505351, 'OTTO'), - (3505401, 'OTTO'), - (3505500, 'robsoner'), - (3505609, 'robsoner'), - (3505708, 'OTTO'), - (3505807, 'BLUZ'), - (3505906, 'robsoner'), - (3506003, 'TELMAV'), - (3506102, 'robsoner'), - (3506201, 'BLUZ'), - (3506300, 'TELMAV'), - (3506359, 'OTTO'), - (3506409, 'BLUZ'), - (3506508, 'BLUZ'), - (3506607, 'OTTO'), - (3506706, 'RONALDL'), - (3506805, 'TELMAV'), - (3506904, 'TELMAV'), - (3507001, 'OTTO'), - (3507100, 'RAFAHLS'), - (3507159, 'OTTO'), - (3507209, 'TELMAV'), - (3507308, 'TELMAV'), - (3507407, 'RONALDL'), - (3507456, 'TELMAV'), - (3507506, 'TELMAV'), - (3507605, 'RAFAHLS'), - (3507704, 'BLUZ'), - (3507753, 'BLUZ'), - (3507803, 'robsoner'), - (3507902, 'RONALDL'), - (3508009, 'OTTO'), - (3508108, 'BLUZ'), - (3508207, 'robsoner'), - (3508306, 'TELMAV'), - (3508405, 'RAFAHLS'), - (3508504, 'RAFAHLS'), - (3508603, 'RAFAHLS'), - (3508702, 'RAFAHLS'), - (3508801, 'TELMAV'), - (3508900, 'BLUZ'), - (3509007, 'OTTO'), - (3509106, 'BLUZ'), - (3509205, 'OTTO'), - (3509254, 'OTTO'), - (3509304, 'robsoner'), - (3509403, 'robsoner'), - (3509452, 'OTTO'), - (3509502, 'RAFAHLS'), - (3509601, 'RAFAHLS'), - (3509700, 'RAFAHLS'), - (3509809, 'TELMAV'), - (3509908, 'OTTO'), - (3509957, 'RAFAHLS'), - (3510005, 'TELMAV'), - (3510104, 'robsoner'), - (3510153, 'TELMAV'), - (3510203, 'OTTO'), - (3510302, 'RAFAHLS'), - (3510401, 'RONALDL'), - (3510500, 'RAFAHLS'), - (3510609, 'OTTO'), - (3510708, 'robsoner'), - (3510807, 'RAFAHLS'), - (3510906, 'robsoner'), - (3511003, 'BLUZ'), - (3511102, 'robsoner'), - (3511201, 'robsoner'), - (3511300, 'robsoner'), - (3511409, 'TELMAV'), - (3511508, 'OTTO'), - (3511607, 'OTTO'), - (3511706, 'RONALDL'), - (3557204, 'TELMAV'), - (3511904, 'BLUZ'), - (3512001, 'robsoner'), - (3512100, 'robsoner'), - (3512209, 'RONALDL'), - (3512308, 'TELMAV'), - (3512407, 'RONALDL'), - (3512506, 'BLUZ'), - (3512605, 'OTTO'), - (3512704, 'RONALDL'), - (3512803, 'RAFAHLS'), - (3512902, 'robsoner'), - (3513009, 'OTTO'), - (3513108, 'robsoner'), - (3513207, 'robsoner'), - (3513306, 'TELMAV'), - (3513405, 'RAFAHLS'), - (3513504, 'OTTO'), - (3513603, 'RAFAHLS'), - (3513702, 'RONALDL'), - (3513801, 'OTTO'), - (3513850, 'robsoner'), - (3513900, 'RAFAHLS'), - (3514007, 'RONALDL'), - (3514106, 'TELMAV'), - (3514205, 'robsoner'), - (3514304, 'RONALDL'), - (3514403, 'BLUZ'), - (3514502, 'TELMAV'), - (3514601, 'robsoner'), - (3514700, 'BLUZ'), - (3514809, 'OTTO'), - (3514908, 'RAFAHLS'), - (3514924, 'robsoner'), - (3514957, 'robsoner'), - (3515004, 'OTTO'), - (3515103, 'OTTO'), - (3515129, 'BLUZ'), - (3515152, 'RAFAHLS'), - (3515186, 'RAFAHLS'), - (3515194, 'TELMAV'), - (3557303, 'RAFAHLS'), - (3515301, 'BLUZ'), - (3515202, 'robsoner'), - (3515350, 'BLUZ'), - (3515400, 'TELMAV'), - (3515608, 'robsoner'), - (3515509, 'robsoner'), - (3515657, 'BLUZ'), - (3515707, 'OTTO'), - (3515806, 'BLUZ'), - (3515905, 'robsoner'), - (3516002, 'BLUZ'), - (3516101, 'TELMAV'), - (3516200, 'robsoner'), - (3516309, 'OTTO'), - (3516408, 'OTTO'), - (3516507, 'BLUZ'), - (3516606, 'BLUZ'), - (3516705, 'BLUZ'), - (3516804, 'robsoner'), - (3516853, 'RONALDL'), - (3516903, 'robsoner'), - (3517000, 'TELMAV'), - (3517109, 'BLUZ'), - (3517208, 'TELMAV'), - (3517307, 'TELMAV'), - (3517406, 'robsoner'), - (3517505, 'robsoner'), - (3517604, 'OTTO'), - (3517703, 'robsoner'), - (3517802, 'BLUZ'), - (3517901, 'robsoner'), - (3518008, 'robsoner'), - (3518107, 'TELMAV'), - (3518206, 'BLUZ'), - (3518305, 'OTTO'), - (3518404, 'RAFAHLS'), - (3518503, 'OTTO'), - (3518602, 'robsoner'), - (3518701, 'OTTO'), - (3518800, 'OTTO'), - (3518859, 'robsoner'), - (3518909, 'robsoner'), - (3519006, 'BLUZ'), - (3519055, 'RAFAHLS'), - (3519071, 'RAFAHLS'), - (3519105, 'TELMAV'), - (3519204, 'BLUZ'), - (3519253, 'TELMAV'), - (3519303, 'RONALDL'), - (3519402, 'robsoner'), - (3519501, 'TELMAV'), - (3519600, 'RONALDL'), - (3519709, 'RAFAHLS'), - (3519808, 'robsoner'), - (3519907, 'TELMAV'), - (3520004, 'TELMAV'), - (3520103, 'robsoner'), - (3520202, 'RAFAHLS'), - (3520301, 'OTTO'), - (3520426, 'OTTO'), - (3520442, 'BLUZ'), - (3520400, 'RAFAHLS'), - (3520509, 'RAFAHLS'), - (3520608, 'BLUZ'), - (3520707, 'robsoner'), - (3520806, 'BLUZ'), - (3520905, 'TELMAV'), - (3521002, 'RAFAHLS'), - (3521101, 'RONALDL'), - (3521150, 'robsoner'), - (3521200, 'OTTO'), - (3521309, 'robsoner'), - (3521408, 'RONALDL'), - (3521507, 'robsoner'), - (3521606, 'BLUZ'), - (3521705, 'OTTO'), - (3521804, 'TELMAV'), - (3521903, 'robsoner'), - (3522000, 'TELMAV'), - (3522109, 'OTTO'), - (3522158, 'OTTO'), - (3522208, 'OTTO'), - (3522307, 'OTTO'), - (3522406, 'OTTO'), - (3522505, 'OTTO'), - (3522604, 'RAFAHLS'), - (3522653, 'OTTO'), - (3522703, 'RONALDL'), - (3522802, 'OTTO'), - (3522901, 'TELMAV'), - (3523008, 'BLUZ'), - (3523107, 'OTTO'), - (3523206, 'OTTO'), - (3523305, 'OTTO'), - (3523404, 'RAFAHLS'), - (3523503, 'TELMAV'), - (3523602, 'RONALDL'), - (3523701, 'robsoner'), - (3523800, 'RAFAHLS'), - (3523909, 'RAFAHLS'), - (3524006, 'RAFAHLS'), - (3524105, 'robsoner'), - (3524204, 'robsoner'), - (3524303, 'robsoner'), - (3524402, 'RAFAHLS'), - (3524501, 'robsoner'), - (3524600, 'OTTO'), - (3524709, 'RAFAHLS'), - (3524808, 'robsoner'), - (3524907, 'RAFAHLS'), - (3525003, 'OTTO'), - (3525102, 'robsoner'), - (3525201, 'RAFAHLS'), - (3525300, 'TELMAV'), - (3525409, 'robsoner'), - (3525508, 'RAFAHLS'), - (3525607, 'BLUZ'), - (3525706, 'robsoner'), - (3525805, 'TELMAV'), - (3525854, 'RONALDL'), - (3525904, 'RAFAHLS'), - (3526001, 'BLUZ'), - (3526100, 'OTTO'), - (3526209, 'OTTO'), - (3526308, 'RAFAHLS'), - (3526407, 'OTTO'), - (3526506, 'BLUZ'), - (3526605, 'RAFAHLS'), - (3526704, 'RONALDL'), - (3526803, 'TELMAV'), - (3526902, 'RONALDL'), - (3527009, 'RAFAHLS'), - (3527108, 'TELMAV'), - (3527207, 'RAFAHLS'), - (3527256, 'BLUZ'), - (3527306, 'RAFAHLS'), - (3527405, 'BLUZ'), - (3527504, 'TELMAV'), - (3527603, 'robsoner'), - (3527702, 'BLUZ'), - (3527801, 'BLUZ'), - (3527900, 'TELMAV'), - (3528007, 'TELMAV'), - (3528106, 'robsoner'), - (3528205, 'robsoner'), - (3528304, 'robsoner'), - (3528403, 'RAFAHLS'), - (3528502, 'OTTO'), - (3528601, 'TELMAV'), - (3528700, 'BLUZ'), - (3528809, 'TELMAV'), - (3528858, 'robsoner'), - (3528908, 'BLUZ'), - (3529005, 'BLUZ'), - (3529104, 'robsoner'), - (3529203, 'BLUZ'), - (3529302, 'RONALDL'), - (3529401, 'OTTO'), - (3529500, 'robsoner'), - (3529609, 'robsoner'), - (3529658, 'robsoner'), - (3529708, 'robsoner'), - (3529807, 'TELMAV'), - (3530003, 'robsoner'), - (3529906, 'OTTO'), - (3530102, 'BLUZ'), - (3530201, 'BLUZ'), - (3530300, 'robsoner'), - (3530409, 'robsoner'), - (3530508, 'RAFAHLS'), - (3530607, 'OTTO'), - (3530706, 'RAFAHLS'), - (3530805, 'RAFAHLS'), - (3530904, 'RONALDL'), - (3531001, 'robsoner'), - (3531100, 'OTTO'), - (3531209, 'RAFAHLS'), - (3531308, 'robsoner'), - (3531407, 'robsoner'), - (3531506, 'robsoner'), - (3531605, 'BLUZ'), - (3531803, 'RAFAHLS'), - (3531704, 'RAFAHLS'), - (3531902, 'robsoner'), - (3532009, 'RAFAHLS'), - (3532058, 'RONALDL'), - (3532108, 'BLUZ'), - (3532157, 'TELMAV'), - (3532207, 'BLUZ'), - (3532306, 'RAFAHLS'), - (3532405, 'RAFAHLS'), - (3532504, 'robsoner'), - (3532603, 'robsoner'), - (3532702, 'robsoner'), - (3532801, 'robsoner'), - (3532827, 'OTTO'), - (3532843, 'robsoner'), - (3532868, 'robsoner'), - (3532900, 'RONALDL'), - (3533007, 'robsoner'), - (3533106, 'BLUZ'), - (3533205, 'BLUZ'), - (3533304, 'robsoner'), - (3533403, 'RAFAHLS'), - (3533254, 'robsoner'), - (3533502, 'robsoner'), - (3533601, 'robsoner'), - (3533700, 'BLUZ'), - (3533809, 'TELMAV'), - (3533908, 'robsoner'), - (3534005, 'robsoner'), - (3534104, 'BLUZ'), - (3534203, 'robsoner'), - (3534302, 'robsoner'), - (3534401, 'OTTO'), - (3534500, 'BLUZ'), - (3534609, 'BLUZ'), - (3534708, 'TELMAV'), - (3534807, 'BLUZ'), - (3534757, 'robsoner'), - (3534906, 'BLUZ'), - (3535002, 'robsoner'), - (3535101, 'robsoner'), - (3535200, 'robsoner'), - (3535309, 'TELMAV'), - (3535408, 'BLUZ'), - (3535507, 'TELMAV'), - (3535606, 'RAFAHLS'), - (3535705, 'robsoner'), - (3535804, 'TELMAV'), - (3535903, 'robsoner'), - (3536000, 'BLUZ'), - (3536109, 'TELMAV'), - (3536208, 'OTTO'), - (3536257, 'robsoner'), - (3536307, 'robsoner'), - (3536406, 'BLUZ'), - (3536505, 'RAFAHLS'), - (3536570, 'TELMAV'), - (3536604, 'robsoner'), - (3536703, 'TELMAV'), - (3536802, 'RAFAHLS'), - (3536901, 'robsoner'), - (3537008, 'robsoner'), - (3537107, 'RAFAHLS'), - (3537156, 'TELMAV'), - (3537206, 'OTTO'), - (3537305, 'BLUZ'), - (3537404, 'BLUZ'), - (3537503, 'OTTO'), - (3537602, 'OTTO'), - (3537701, 'BLUZ'), - (3537800, 'RAFAHLS'), - (3537909, 'RAFAHLS'), - (3538006, 'RAFAHLS'), - (3538105, 'robsoner'), - (3538204, 'RAFAHLS'), - (3538303, 'BLUZ'), - (3538501, 'RAFAHLS'), - (3538600, 'RAFAHLS'), - (3538709, 'RONALDL'), - (3538808, 'TELMAV'), - (3538907, 'TELMAV'), - (3539004, 'robsoner'), - (3539103, 'OTTO'), - (3539202, 'BLUZ'), - (3539301, 'RAFAHLS'), - (3539400, 'TELMAV'), - (3539509, 'robsoner'), - (3539608, 'robsoner'), - (3539707, 'TELMAV'), - (3539806, 'OTTO'), - (3539905, 'robsoner'), - (3540002, 'BLUZ'), - (3540101, 'TELMAV'), - (3540200, 'robsoner'), - (3540259, 'robsoner'), - (3540309, 'robsoner'), - (3540408, 'robsoner'), - (3540507, 'OTTO'), - (3540606, 'RAFAHLS'), - (3540705, 'RAFAHLS'), - (3540754, 'RAFAHLS'), - (3540804, 'robsoner'), - (3540853, 'BLUZ'), - (3540903, 'robsoner'), - (3541000, 'OTTO'), - (3541059, 'TELMAV'), - (3541109, 'TELMAV'), - (3541208, 'BLUZ'), - (3541307, 'BLUZ'), - (3541406, 'BLUZ'), - (3541505, 'BLUZ'), - (3541604, 'TELMAV'), - (3541653, 'OTTO'), - (3541703, 'TELMAV'), - (3541802, 'BLUZ'), - (3541901, 'RAFAHLS'), - (3542008, 'BLUZ'), - (3542107, 'RONALDL'), - (3542206, 'BLUZ'), - (3542305, 'RAFAHLS'), - (3542404, 'BLUZ'), - (3542503, 'TELMAV'), - (3542602, 'OTTO'), - (3542701, 'robsoner'), - (3542800, 'OTTO'), - (3542909, 'RONALDL'), - (3543006, 'OTTO'), - (3543105, 'robsoner'), - (3543204, 'TELMAV'), - (3543238, 'BLUZ'), - (3543253, 'OTTO'), - (3543303, 'OTTO'), - (3543402, 'robsoner'), - (3543600, 'robsoner'), - (3543709, 'RONALDL'), - (3543808, 'BLUZ'), - (3543907, 'RONALDL'), - (3544004, 'RONALDL'), - (3544103, 'OTTO'), - (3544202, 'robsoner'), - (3543501, 'OTTO'), - (3544251, 'BLUZ'), - (3544301, 'RAFAHLS'), - (3544400, 'BLUZ'), - (3544509, 'robsoner'), - (3544608, 'TELMAV'), - (3544707, 'BLUZ'), - (3544806, 'robsoner'), - (3544905, 'robsoner'), - (3545001, 'OTTO'), - (3545100, 'BLUZ'), - (3545159, 'RONALDL'), - (3545209, 'RAFAHLS'), - (3545308, 'RAFAHLS'), - (3545407, 'TELMAV'), - (3545506, 'BLUZ'), - (3545605, 'robsoner'), - (3545704, 'robsoner'), - (3545803, 'RAFAHLS'), - (3546009, 'RAFAHLS'), - (3546108, 'robsoner'), - (3546207, 'RONALDL'), - (3546256, 'robsoner'), - (3546306, 'RAFAHLS'), - (3546405, 'TELMAV'), - (3546504, 'robsoner'), - (3546603, 'robsoner'), - (3546702, 'RONALDL'), - (3546801, 'OTTO'), - (3546900, 'RONALDL'), - (3547007, 'RONALDL'), - (3547106, 'BLUZ'), - (3547502, 'robsoner'), - (3547403, 'robsoner'), - (3547601, 'robsoner'), - (3547650, 'robsoner'), - (3547205, 'robsoner'), - (3547304, 'OTTO'), - (3547700, 'BLUZ'), - (3547809, 'OTTO'), - (3547908, 'robsoner'), - (3548005, 'RAFAHLS'), - (3548054, 'BLUZ'), - (3548104, 'RAFAHLS'), - (3548203, 'RAFAHLS'), - (3548302, 'BLUZ'), - (3548401, 'BLUZ'), - (3548500, 'OTTO'), - (3548609, 'RAFAHLS'), - (3548708, 'OTTO'), - (3548807, 'OTTO'), - (3548906, 'RONALDL'), - (3549003, 'robsoner'), - (3549102, 'RAFAHLS'), - (3549201, 'robsoner'), - (3549250, 'robsoner'), - (3549300, 'BLUZ'), - (3549409, 'robsoner'), - (3549508, 'robsoner'), - (3549607, 'RAFAHLS'), - (3549706, 'RAFAHLS'), - (3549805, 'robsoner'), - (3549904, 'RAFAHLS'), - (3549953, 'OTTO'), - (3550001, 'RAFAHLS'), - (3550100, 'TELMAV'), - (3550209, 'RAFAHLS'), - (3550308, 'OTTO'), - (3550407, 'RONALDL'), - (3550506, 'TELMAV'), - (3550605, 'RAFAHLS'), - (3550704, 'RAFAHLS'), - (3550803, 'RAFAHLS'), - (3550902, 'robsoner'), - (3551009, 'OTTO'), - (3551108, 'RAFAHLS'), - (3551207, 'TELMAV'), - (3551306, 'robsoner'), - (3551405, 'robsoner'), - (3551603, 'RAFAHLS'), - (3551504, 'robsoner'), - (3551702, 'robsoner'), - (3551801, 'OTTO'), - (3551900, 'robsoner'), - (3552007, 'RAFAHLS'), - (3552106, 'RAFAHLS'), - (3552205, 'RAFAHLS'), - (3552304, 'BLUZ'), - (3552403, 'RAFAHLS'), - (3552551, 'BLUZ'), - (3552502, 'OTTO'), - (3552601, 'robsoner'), - (3552700, 'RONALDL'), - (3552809, 'OTTO'), - (3552908, 'BLUZ'), - (3553005, 'TELMAV'), - (3553104, 'robsoner'), - (3553203, 'robsoner'), - (3553302, 'RAFAHLS'), - (3553401, 'robsoner'), - (3553500, 'RAFAHLS'), - (3553609, 'RAFAHLS'), - (3553658, 'robsoner'), - (3553708, 'robsoner'), - (3553807, 'OTTO'), - (3553856, 'OTTO'), - (3553906, 'BLUZ'), - (3553955, 'TELMAV'), - (3554003, 'OTTO'), - (3554102, 'RAFAHLS'), - (3554201, 'TELMAV'), - (3554300, 'BLUZ'), - (3554409, 'robsoner'), - (3554508, 'RONALDL'), - (3554607, 'TELMAV'), - (3554656, 'OTTO'), - (3554706, 'RONALDL'), - (3554755, 'RONALDL'), - (3554805, 'RAFAHLS'), - (3554904, 'robsoner'), - (3554953, 'RAFAHLS'), - (3555000, 'BLUZ'), - (3555109, 'BLUZ'), - (3555208, 'BLUZ'), - (3555307, 'robsoner'), - (3555356, 'robsoner'), - (3555406, 'RAFAHLS'), - (3555505, 'TELMAV'), - (3555604, 'robsoner'), - (3555703, 'robsoner'), - (3555802, 'robsoner'), - (3555901, 'TELMAV'), - (3556008, 'robsoner'), - (3556107, 'robsoner'), - (3556206, 'RAFAHLS'), - (3556305, 'BLUZ'), - (3556354, 'RAFAHLS'), - (3556404, 'RAFAHLS'), - (3556453, 'OTTO'), - (3556503, 'RAFAHLS'), - (3556602, 'BLUZ'), - (3556701, 'RAFAHLS'), - (3556800, 'robsoner'), - (3556909, 'robsoner'), - (3556958, 'robsoner'), - (3557006, 'RAFAHLS'), - (3557105, 'robsoner'), - (3557154, 'robsoner'), - (4100608, 'PATI'), - (4100905, 'PATI'), - (4106704, 'PATI'), - (4107108, 'PATI'), - (4108908, 'PATI'), - (4110300, 'PATI'), - (4111308, 'PATI'), - (4112603, 'PATI'), - (4113502, 'PATI'), - (4115002, 'PATI'), - (4115903, 'PATI'), - (4116505, 'PATI'), - (4117107, 'PATI'), - (4118006, 'PATI'), - (4118105, 'PATI'), - (4118303, 'PATI'), - (4118402, 'PATI'), - (4119707, 'PATI'), - (4120200, 'PATI'), - (4121000, 'PATI'), - (4123303, 'PATI'), - (4123709, 'PATI'), - (4123956, 'PATI'), - (4124202, 'PATI'), - (4124608, 'PATI'), - (4124905, 'PATI'), - (4125902, 'PATI'), - (4126702, 'PATI'), - (4127304, 'PATI'), - (4100509, 'PATI'), - (4100707, 'PATI'), - (4103370, 'PATI'), - (4103479, 'PATI'), - (4106605, 'PATI'), - (4107256, 'PATI'), - (4107520, 'PATI'), - (4108320, 'PATI'), - (4109906, 'PATI'), - (4110607, 'PATI'), - (4111555, 'PATI'), - (4114708, 'PATI'), - (4115101, 'PATI'), - (4117206, 'PATI'), - (4118857, 'PATI'), - (4118907, 'PATI'), - (4125357, 'PATI'), - (4126900, 'PATI'), - (4128104, 'PATI'), - (4128625, 'PATI'), - (4128807, 'PATI'), - (4105508, 'PATI'), - (4105607, 'PATI'), - (4109104, 'PATI'), - (4110409, 'PATI'), - (4112405, 'PATI'), - (4113007, 'PATI'), - (4122602, 'PATI'), - (4125555, 'PATI'), - (4126108, 'PATI'), - (4126801, 'PATI'), - (4127908, 'PATI'), - (4100459, 'PATI'), - (4103008, 'PATI'), - (4103909, 'PATI'), - (4108601, 'PATI'), - (4112207, 'PATI'), - (4112959, 'PATI'), - (4116109, 'PATI'), - (4116802, 'PATI'), - (4120655, 'PATI'), - (4121356, 'PATI'), - (4128005, 'PATI'), - (4101705, 'PATI'), - (4102505, 'PATI'), - (4104303, 'PATI'), - (4106555, 'PATI'), - (4107504, 'PATI'), - (4107553, 'PATI'), - (4107702, 'PATI'), - (4110805, 'PATI'), - (4113734, 'PATI'), - (4114005, 'PATI'), - (4118808, 'PATI'), - (4121109, 'PATI'), - (4122503, 'PATI'), - (4127205, 'PATI'), - (4101150, 'RONALDL'), - (4102109, 'RONALDL'), - (4102208, 'RONALDL'), - (4103404, 'RONALDL'), - (4105102, 'RONALDL'), - (4105904, 'RONALDL'), - (4108106, 'RONALDL'), - (4109203, 'RONALDL'), - (4110003, 'RONALDL'), - (4110904, 'RONALDL'), - (4111902, 'RONALDL'), - (4113601, 'RONALDL'), - (4113809, 'RONALDL'), - (4114104, 'RONALDL'), - (4116307, 'RONALDL'), - (4116406, 'RONALDL'), - (4116901, 'RONALDL'), - (4120408, 'RONALDL'), - (4123402, 'RONALDL'), - (4123600, 'RONALDL'), - (4124509, 'RONALDL'), - (4128302, 'RONALDL'), - (4100806, 'RONALDL'), - (4102802, 'RONALDL'), - (4108007, 'RONALDL'), - (4116000, 'RONALDL'), - (4120002, 'RONALDL'), - (4120333, 'RONALDL'), - (4120507, 'RONALDL'), - (4126504, 'RONALDL'), - (4107306, 'RONALDL'), - (4107801, 'RONALDL'), - (4107900, 'RONALDL'), - (4111100, 'RONALDL'), - (4111605, 'RONALDL'), - (4117404, 'RONALDL'), - (4125308, 'RONALDL'), - (4114203, 'RONALDL'), - (4114807, 'RONALDL'), - (4115200, 'RONALDL'), - (4117503, 'RONALDL'), - (4126256, 'RONALDL'), - (4101408, 'RONALDL'), - (4101507, 'RONALDL'), - (4103503, 'RONALDL'), - (4103800, 'RONALDL'), - (4112108, 'RONALDL'), - (4114906, 'RONALDL'), - (4115754, 'RONALDL'), - (4117297, 'RONALDL'), - (4122701, 'RONALDL'), - (4103701, 'RONALDL'), - (4109807, 'RONALDL'), - (4113700, 'RONALDL'), - (4119657, 'RONALDL'), - (4122404, 'RONALDL'), - (4126678, 'RONALDL'), - (4103206, 'RONALDL'), - (4103305, 'RONALDL'), - (4106852, 'RONALDL'), - (4107603, 'RONALDL'), - (4113106, 'RONALDL'), - (4115507, 'RONALDL'), - (4122107, 'RONALDL'), - (4101655, 'RONALDL'), - (4101853, 'RONALDL'), - (4104402, 'RONALDL'), - (4108551, 'RONALDL'), - (4108700, 'RONALDL'), - (4111506, 'RONALDL'), - (4112504, 'RONALDL'), - (4113429, 'RONALDL'), - (4113759, 'RONALDL'), - (4114500, 'RONALDL'), - (4117271, 'RONALDL'), - (4122172, 'RONALDL'), - (4122651, 'RONALDL'), - (4125001, 'RONALDL'), - (4125803, 'RONALDL'), - (4101903, 'robsoner'), - (4112702, 'robsoner'), - (4117214, 'robsoner'), - (4121307, 'robsoner'), - (4123204, 'robsoner'), - (4124707, 'robsoner'), - (4126009, 'robsoner'), - (4128401, 'robsoner'), - (4100103, 'robsoner'), - (4101101, 'robsoner'), - (4102406, 'robsoner'), - (4106001, 'robsoner'), - (4106407, 'robsoner'), - (4111001, 'robsoner'), - (4113403, 'robsoner'), - (4116604, 'robsoner'), - (4117008, 'robsoner'), - (4121901, 'robsoner'), - (4123105, 'robsoner'), - (4123907, 'robsoner'), - (4124301, 'robsoner'), - (4126405, 'robsoner'), - (4102703, 'robsoner'), - (4103602, 'robsoner'), - (4111803, 'robsoner'), - (4112900, 'robsoner'), - (4121802, 'robsoner'), - (4124103, 'robsoner'), - (4106100, 'robsoner'), - (4107009, 'robsoner'), - (4107751, 'robsoner'), - (4109708, 'robsoner'), - (4111704, 'robsoner'), - (4112306, 'robsoner'), - (4119202, 'robsoner'), - (4126207, 'robsoner'), - (4104709, 'robsoner'), - (4109005, 'robsoner'), - (4112801, 'robsoner'), - (4120705, 'robsoner'), - (4122909, 'robsoner'), - (4124004, 'robsoner'), - (4125407, 'robsoner'), - (4126603, 'robsoner'), - (4127809, 'robsoner'), - (4128500, 'robsoner'), - (4110078, 'TELMAV'), - (4117305, 'TELMAV'), - (4121703, 'TELMAV'), - (4127106, 'TELMAV'), - (4127502, 'TELMAV'), - (4128534, 'TELMAV'), - (4101606, 'TELMAV'), - (4112009, 'TELMAV'), - (4119400, 'TELMAV'), - (4126306, 'TELMAV'), - (4104659, 'TELMAV'), - (4104907, 'TELMAV'), - (4117701, 'TELMAV'), - (4119905, 'TELMAV'), - (4102000, 'PATI'), - (4107157, 'PATI'), - (4107538, 'PATI'), - (4108205, 'PATI'), - (4108809, 'PATI'), - (4110656, 'PATI'), - (4112751, 'PATI'), - (4114609, 'PATI'), - (4115358, 'PATI'), - (4115853, 'PATI'), - (4117222, 'PATI'), - (4117453, 'PATI'), - (4117909, 'PATI'), - (4118451, 'PATI'), - (4120853, 'PATI'), - (4123501, 'PATI'), - (4125456, 'PATI'), - (4125753, 'PATI'), - (4127403, 'PATI'), - (4127700, 'PATI'), - (4127957, 'PATI'), - (4101051, 'PATI'), - (4103057, 'PATI'), - (4103354, 'PATI'), - (4103453, 'PATI'), - (4104055, 'PATI'), - (4104600, 'PATI'), - (4104808, 'PATI'), - (4105003, 'PATI'), - (4106308, 'PATI'), - (4107124, 'PATI'), - (4109302, 'PATI'), - (4109757, 'PATI'), - (4110052, 'PATI'), - (4113452, 'PATI'), - (4116703, 'PATI'), - (4123824, 'PATI'), - (4124020, 'PATI'), - (4127858, 'PATI'), - (4105300, 'PATI'), - (4108304, 'PATI'), - (4110953, 'PATI'), - (4115606, 'PATI'), - (4115804, 'PATI'), - (4116059, 'PATI'), - (4121257, 'PATI'), - (4124053, 'PATI'), - (4125704, 'PATI'), - (4126355, 'PATI'), - (4128559, 'PATI'), - (4101002, 'OTTO'), - (4102752, 'OTTO'), - (4104501, 'OTTO'), - (4119004, 'OTTO'), - (4119806, 'OTTO'), - (4120358, 'OTTO'), - (4121406, 'OTTO'), - (4123808, 'OTTO'), - (4102604, 'OTTO'), - (4103024, 'OTTO'), - (4103156, 'OTTO'), - (4106571, 'OTTO'), - (4107207, 'OTTO'), - (4107405, 'OTTO'), - (4107850, 'OTTO'), - (4108403, 'OTTO'), - (4114351, 'OTTO'), - (4115408, 'OTTO'), - (4116950, 'OTTO'), - (4117255, 'OTTO'), - (4119251, 'OTTO'), - (4121604, 'OTTO'), - (4122800, 'OTTO'), - (4123006, 'OTTO'), - (4124400, 'OTTO'), - (4125209, 'OTTO'), - (4128609, 'OTTO'), - (4103222, 'OTTO'), - (4105409, 'OTTO'), - (4106506, 'OTTO'), - (4111209, 'OTTO'), - (4115309, 'OTTO'), - (4118501, 'OTTO'), - (4124806, 'OTTO'), - (4126272, 'OTTO'), - (4126652, 'OTTO'), - (4128708, 'OTTO'), - (4103040, 'pillarap'), - (4113254, 'pillarap'), - (4115739, 'pillarap'), - (4117800, 'pillarap'), - (4119608, 'pillarap'), - (4123857, 'pillarap'), - (4103958, 'pillarap'), - (4104428, 'pillarap'), - (4104451, 'pillarap'), - (4107546, 'pillarap'), - (4108452, 'pillarap'), - (4108650, 'pillarap'), - (4109401, 'pillarap'), - (4110201, 'pillarap'), - (4113304, 'pillarap'), - (4115457, 'pillarap'), - (4117057, 'pillarap'), - (4119301, 'pillarap'), - (4120150, 'pillarap'), - (4120903, 'pillarap'), - (4121752, 'pillarap'), - (4122156, 'pillarap'), - (4127965, 'pillarap'), - (4128658, 'pillarap'), - (4105706, 'pillarap'), - (4106456, 'pillarap'), - (4109658, 'pillarap'), - (4114401, 'pillarap'), - (4117602, 'pillarap'), - (4107736, 'pillarap'), - (4108957, 'pillarap'), - (4110102, 'pillarap'), - (4110508, 'pillarap'), - (4111407, 'pillarap'), - (4120606, 'pillarap'), - (4127007, 'pillarap'), - (4110706, 'pillarap'), - (4113908, 'pillarap'), - (4121505, 'pillarap'), - (4122008, 'pillarap'), - (4102901, 'pillarap'), - (4106803, 'pillarap'), - (4108502, 'pillarap'), - (4118600, 'pillarap'), - (4118709, 'pillarap'), - (4120309, 'pillarap'), - (4128203, 'pillarap'), - (4101309, 'pillarap'), - (4125100, 'pillarap'), - (4125605, 'pillarap'), - (4100202, 'pillarap'), - (4105201, 'pillarap'), - (4128633, 'pillarap'), - (4113205, 'pillarap'), - (4120101, 'pillarap'), - (4100400, 'pillarap'), - (4101804, 'pillarap'), - (4102307, 'pillarap'), - (4103107, 'pillarap'), - (4104006, 'pillarap'), - (4104204, 'pillarap'), - (4104253, 'pillarap'), - (4105805, 'pillarap'), - (4106209, 'pillarap'), - (4106902, 'pillarap'), - (4107652, 'pillarap'), - (4111258, 'pillarap'), - (4114302, 'pillarap'), - (4119152, 'pillarap'), - (4119509, 'pillarap'), - (4120804, 'pillarap'), - (4122206, 'pillarap'), - (4125506, 'pillarap'), - (4127882, 'pillarap'), - (4101200, 'pillarap'), - (4109500, 'pillarap'), - (4109609, 'pillarap'), - (4115705, 'pillarap'), - (4116208, 'pillarap'), - (4118204, 'pillarap'), - (4119954, 'pillarap'), - (4100301, 'pillarap'), - (4104105, 'pillarap'), - (4119103, 'pillarap'), - (4121208, 'pillarap'), - (4122305, 'pillarap'), - (4127601, 'pillarap'), - (4200051, 'ADAL'), - (4200101, 'ADAL'), - (4200200, 'LILIANE'), - (4200309, 'LILIANE'), - (4200408, 'ADAL'), - (4200507, 'ADAL'), - (4200556, 'ADAL'), - (4200606, 'ADAL'), - (4200705, 'ADAL'), - (4200754, 'ADAL'), - (4200804, 'ADAL'), - (4200903, 'ADAL'), - (4201000, 'ADAL'), - (4201109, 'ADAL'), - (4201208, 'ADAL'), - (4201257, 'LILIANE'), - (4201273, 'ADAL'), - (4201307, 'LILIANE'), - (4201406, 'RONALDL'), - (4201505, 'RONALDL'), - (4201604, 'ADAL'), - (4201653, 'ADAL'), - (4201703, 'LILIANE'), - (4201802, 'LILIANE'), - (4201901, 'LILIANE'), - (4201950, 'RONALDL'), - (4202057, 'LILIANE'), - (4202008, 'LILIANE'), - (4202073, 'RONALDL'), - (4212809, 'LILIANE'), - (4220000, 'RONALDL'), - (4202081, 'ADAL'), - (4202099, 'ADAL'), - (4202107, 'LILIANE'), - (4202131, 'LILIANE'), - (4202156, 'ADAL'), - (4202206, 'LILIANE'), - (4202305, 'ADAL'), - (4202404, 'LILIANE'), - (4202438, 'ADAL'), - (4202503, 'ADAL'), - (4202537, 'ADAL'), - (4202578, 'ADAL'), - (4202602, 'ADAL'), - (4202453, 'LILIANE'), - (4202701, 'LILIANE'), - (4202800, 'RONALDL'), - (4202859, 'LILIANE'), - (4202875, 'ADAL'), - (4202909, 'LILIANE'), - (4203006, 'ADAL'), - (4203105, 'ADAL'), - (4203154, 'ADAL'), - (4203204, 'LILIANE'), - (4203303, 'LILIANE'), - (4203402, 'ADAL'), - (4203501, 'ADAL'), - (4203600, 'ADAL'), - (4203709, 'ADAL'), - (4203808, 'LILIANE'), - (4203253, 'ADAL'), - (4203907, 'ADAL'), - (4203956, 'RONALDL'), - (4204004, 'ADAL'), - (4204103, 'ADAL'), - (4204152, 'ADAL'), - (4204178, 'ADAL'), - (4204194, 'LILIANE'), - (4204202, 'ADAL'), - (4204251, 'RONALDL'), - (4204301, 'ADAL'), - (4204350, 'ADAL'), - (4204400, 'ADAL'), - (4204459, 'ADAL'), - (4204558, 'ADAL'), - (4204509, 'LILIANE'), - (4204608, 'RONALDL'), - (4204707, 'ADAL'), - (4204756, 'ADAL'), - (4204806, 'ADAL'), - (4204905, 'ADAL'), - (4205001, 'ADAL'), - (4205100, 'LILIANE'), - (4205159, 'LILIANE'), - (4205175, 'ADAL'), - (4205191, 'RONALDL'), - (4205209, 'ADAL'), - (4205308, 'ADAL'), - (4205357, 'ADAL'), - (4205407, 'ADAL'), - (4205431, 'ADAL'), - (4205456, 'RONALDL'), - (4205506, 'ADAL'), - (4205555, 'ADAL'), - (4205605, 'ADAL'), - (4205704, 'RONALDL'), - (4205803, 'LILIANE'), - (4205902, 'LILIANE'), - (4206009, 'ADAL'), - (4206108, 'RONALDL'), - (4206207, 'RONALDL'), - (4206306, 'LILIANE'), - (4206405, 'ADAL'), - (4206504, 'LILIANE'), - (4206603, 'ADAL'), - (4206652, 'ADAL'), - (4206702, 'ADAL'), - (4206751, 'ADAL'), - (4206801, 'ADAL'), - (4206900, 'LILIANE'), - (4207007, 'RONALDL'), - (4207106, 'LILIANE'), - (4207205, 'RONALDL'), - (4207304, 'RONALDL'), - (4207403, 'LILIANE'), - (4207502, 'LILIANE'), - (4207577, 'ADAL'), - (4207601, 'ADAL'), - (4207650, 'ADAL'), - (4207684, 'ADAL'), - (4207700, 'ADAL'), - (4207759, 'ADAL'), - (4207809, 'ADAL'), - (4207858, 'ADAL'), - (4207908, 'LILIANE'), - (4208005, 'ADAL'), - (4208104, 'LILIANE'), - (4208203, 'LILIANE'), - (4208302, 'LILIANE'), - (4208401, 'ADAL'), - (4208450, 'LILIANE'), - (4208500, 'LILIANE'), - (4208609, 'ADAL'), - (4208708, 'RONALDL'), - (4208807, 'RONALDL'), - (4208906, 'LILIANE'), - (4208955, 'ADAL'), - (4209003, 'ADAL'), - (4209102, 'LILIANE'), - (4209151, 'LILIANE'), - (4209177, 'ADAL'), - (4209201, 'ADAL'), - (4209300, 'ADAL'), - (4209409, 'RONALDL'), - (4209458, 'ADAL'), - (4209508, 'LILIANE'), - (4209607, 'RONALDL'), - (4209706, 'ADAL'), - (4209805, 'ADAL'), - (4209854, 'ADAL'), - (4209904, 'LILIANE'), - (4210001, 'LILIANE'), - (4210035, 'ADAL'), - (4210050, 'ADAL'), - (4210100, 'LILIANE'), - (4210209, 'ADAL'), - (4210308, 'LILIANE'), - (4210407, 'RONALDL'), - (4210506, 'ADAL'), - (4210555, 'ADAL'), - (4210605, 'LILIANE'), - (4210704, 'ADAL'), - (4210803, 'RONALDL'), - (4210852, 'LILIANE'), - (4210902, 'ADAL'), - (4211009, 'ADAL'), - (4211058, 'ADAL'), - (4211108, 'LILIANE'), - (4211207, 'RONALDL'), - (4211256, 'RONALDL'), - (4211306, 'LILIANE'), - (4211405, 'ADAL'), - (4211454, 'ADAL'), - (4211504, 'ADAL'), - (4211603, 'RONALDL'), - (4211652, 'ADAL'), - (4211702, 'RONALDL'), - (4211751, 'ADAL'), - (4211801, 'ADAL'), - (4211850, 'ADAL'), - (4211876, 'ADAL'), - (4211892, 'ADAL'), - (4211900, 'ADAL'), - (4212007, 'ADAL'), - (4212056, 'ADAL'), - (4212106, 'ADAL'), - (4212205, 'LILIANE'), - (4212239, 'ADAL'), - (4212254, 'RONALDL'), - (4212270, 'ADAL'), - (4212304, 'ADAL'), - (4212403, 'RONALDL'), - (4212502, 'LILIANE'), - (4212601, 'ADAL'), - (4212650, 'RONALDL'), - (4212700, 'LILIANE'), - (4212908, 'ADAL'), - (4213005, 'ADAL'), - (4213104, 'ADAL'), - (4213153, 'ADAL'), - (4213203, 'LILIANE'), - (4213302, 'ADAL'), - (4213351, 'ADAL'), - (4213401, 'ADAL'), - (4213500, 'LILIANE'), - (4213609, 'LILIANE'), - (4213708, 'LILIANE'), - (4213807, 'RONALDL'), - (4213906, 'ADAL'), - (4214003, 'LILIANE'), - (4214102, 'LILIANE'), - (4214151, 'ADAL'), - (4214201, 'ADAL'), - (4214300, 'ADAL'), - (4214409, 'ADAL'), - (4214508, 'LILIANE'), - (4214607, 'LILIANE'), - (4214805, 'LILIANE'), - (4214706, 'LILIANE'), - (4214904, 'RONALDL'), - (4215000, 'LILIANE'), - (4215059, 'ADAL'), - (4215075, 'ADAL'), - (4215109, 'LILIANE'), - (4215208, 'ADAL'), - (4215307, 'LILIANE'), - (4215356, 'ADAL'), - (4215406, 'ADAL'), - (4215455, 'RONALDL'), - (4215505, 'ADAL'), - (4215554, 'ADAL'), - (4215604, 'RONALDL'), - (4215653, 'RONALDL'), - (4215679, 'LILIANE'), - (4215687, 'ADAL'), - (4215695, 'ADAL'), - (4215703, 'ADAL'), - (4215802, 'LILIANE'), - (4215752, 'ADAL'), - (4215901, 'ADAL'), - (4216008, 'ADAL'), - (4216057, 'ADAL'), - (4216107, 'ADAL'), - (4216206, 'LILIANE'), - (4216305, 'ADAL'), - (4216354, 'LILIANE'), - (4216255, 'ADAL'), - (4216404, 'RONALDL'), - (4216503, 'ADAL'), - (4216602, 'ADAL'), - (4216701, 'ADAL'), - (4216800, 'ADAL'), - (4216909, 'ADAL'), - (4217006, 'RONALDL'), - (4217105, 'RONALDL'), - (4217154, 'ADAL'), - (4217204, 'ADAL'), - (4217253, 'ADAL'), - (4217303, 'ADAL'), - (4217402, 'LILIANE'), - (4217501, 'ADAL'), - (4217550, 'ADAL'), - (4217600, 'RONALDL'), - (4217709, 'RONALDL'), - (4217758, 'ADAL'), - (4217808, 'LILIANE'), - (4217907, 'ADAL'), - (4217956, 'ADAL'), - (4218004, 'ADAL'), - (4218103, 'RONALDL'), - (4218202, 'LILIANE'), - (4218251, 'LILIANE'), - (4218301, 'LILIANE'), - (4218350, 'RONALDL'), - (4218400, 'RONALDL'), - (4218509, 'ADAL'), - (4218608, 'LILIANE'), - (4218707, 'RONALDL'), - (4218756, 'ADAL'), - (4218806, 'RONALDL'), - (4218855, 'ADAL'), - (4218905, 'ADAL'), - (4218954, 'ADAL'), - (4219002, 'RONALDL'), - (4219101, 'ADAL'), - (4219150, 'ADAL'), - (4219176, 'ADAL'), - (4219200, 'LILIANE'), - (4219309, 'ADAL'), - (4219358, 'LILIANE'), - (4219408, 'LILIANE'), - (4219507, 'ADAL'), - (4219606, 'ADAL'), - (4219705, 'ADAL'), - (4219853, 'ADAL'), - (4300034, 'RAFAHLS'), - (4300059, 'LFERNAN'), - (4300109, 'janarycn'), - (4300208, 'LFERNAN'), - (4300307, 'LFERNAN'), - (4300406, 'RAFAHLS'), - (4300455, 'LFERNAN'), - (4300471, 'LFERNAN'), - (4300505, 'LFERNAN'), - (4300554, 'LFERNAN'), - (4300570, 'JBGOIS'), - (4300604, 'JBGOIS'), - (4300638, 'JBGOIS'), - (4300646, 'LFERNAN'), - (4300661, 'BLUZ'), - (4300703, 'BLUZ'), - (4300802, 'BLUZ'), - (4300851, 'JBGOIS'), - (4300877, 'JBGOIS'), - (4300901, 'LFERNAN'), - (4301008, 'MARGARET'), - (4301073, 'JBGOIS'), - (4301057, 'JBGOIS'), - (4301206, 'MARGARET'), - (4301107, 'JBGOIS'), - (4301305, 'JBGOIS'), - (4301404, 'BLUZ'), - (4301503, 'LFERNAN'), - (4301552, 'LFERNAN'), - (4301602, 'RAFAHLS'), - (4301636, 'JBGOIS'), - (4301651, 'JBGOIS'), - (4301701, 'LFERNAN'), - (4301750, 'JBGOIS'), - (4301859, 'LFERNAN'), - (4301875, 'RAFAHLS'), - (4301909, 'JBGOIS'), - (4301925, 'LFERNAN'), - (4301958, 'LFERNAN'), - (4301800, 'LFERNAN'), - (4302006, 'LFERNAN'), - (4302055, 'LFERNAN'), - (4302105, 'BLUZ'), - (4302154, 'LFERNAN'), - (4302204, 'LFERNAN'), - (4302220, 'LFERNAN'), - (4302238, 'LFERNAN'), - (4302253, 'BLUZ'), - (4302303, 'BLUZ'), - (4302352, 'JBGOIS'), - (4302378, 'LFERNAN'), - (4302402, 'MARGARET'), - (4302451, 'MARGARET'), - (4302501, 'LFERNAN'), - (4302584, 'LFERNAN'), - (4302600, 'LFERNAN'), - (4302659, 'JBGOIS'), - (4302709, 'JBGOIS'), - (4302808, 'JBGOIS'), - (4302907, 'janarycn'), - (4303004, 'MARGARET'), - (4303103, 'JBGOIS'), - (4303202, 'LFERNAN'), - (4303301, 'LFERNAN'), - (4303400, 'LFERNAN'), - (4303509, 'JBGOIS'), - (4303558, 'LFERNAN'), - (4303608, 'BLUZ'), - (4303673, 'BLUZ'), - (4303707, 'LFERNAN'), - (4303806, 'LFERNAN'), - (4303905, 'JBGOIS'), - (4304002, 'LFERNAN'), - (4304101, 'LFERNAN'), - (4304200, 'MARGARET'), - (4304309, 'LFERNAN'), - (4304358, 'JBGOIS'), - (4304408, 'JBGOIS'), - (4304507, 'JBGOIS'), - (4304606, 'JBGOIS'), - (4304614, 'MARGARET'), - (4304622, 'BLUZ'), - (4304630, 'JBGOIS'), - (4304655, 'janarycn'), - (4304663, 'JBGOIS'), - (4304689, 'JBGOIS'), - (4304697, 'MARGARET'), - (4304671, 'JBGOIS'), - (4304713, 'JBGOIS'), - (4304705, 'LFERNAN'), - (4304804, 'BLUZ'), - (4304853, 'LFERNAN'), - (4304903, 'LFERNAN'), - (4304952, 'LFERNAN'), - (4305009, 'LFERNAN'), - (4305108, 'BLUZ'), - (4305116, 'LFERNAN'), - (4305124, 'JBGOIS'), - (4305132, 'MARGARET'), - (4305157, 'LFERNAN'), - (4305173, 'JBGOIS'), - (4305207, 'LFERNAN'), - (4305306, 'LFERNAN'), - (4305355, 'JBGOIS'), - (4305371, 'LFERNAN'), - (4305405, 'LFERNAN'), - (4305439, 'JBGOIS'), - (4305447, 'JBGOIS'), - (4305454, 'JBGOIS'), - (4305504, 'LFERNAN'), - (4305587, 'MARGARET'), - (4305603, 'LFERNAN'), - (4305702, 'LFERNAN'), - (4305801, 'LFERNAN'), - (4305835, 'MARGARET'), - (4305850, 'LFERNAN'), - (4305871, 'LFERNAN'), - (4305900, 'LFERNAN'), - (4305934, 'BLUZ'), - (4305959, 'BLUZ'), - (4305975, 'LFERNAN'), - (4306007, 'LFERNAN'), - (4306056, 'JBGOIS'), - (4306072, 'LFERNAN'), - (4306106, 'LFERNAN'), - (4306130, 'LFERNAN'), - (4306205, 'MARGARET'), - (4306304, 'LFERNAN'), - (4306320, 'LFERNAN'), - (4306353, 'LFERNAN'), - (4306379, 'janarycn'), - (4306403, 'JBGOIS'), - (4306429, 'LFERNAN'), - (4306452, 'BLUZ'), - (4306502, 'JBGOIS'), - (4306601, 'RAFAHLS'), - (4306551, 'JBGOIS'), - (4306700, 'janarycn'), - (4306734, 'LFERNAN'), - (4306759, 'MARGARET'), - (4306767, 'JBGOIS'), - (4306809, 'MARGARET'), - (4306908, 'JBGOIS'), - (4306924, 'LFERNAN'), - (4306957, 'LFERNAN'), - (4306932, 'LFERNAN'), - (4306973, 'LFERNAN'), - (4307005, 'LFERNAN'), - (4307054, 'LFERNAN'), - (4307203, 'LFERNAN'), - (4307302, 'LFERNAN'), - (4307401, 'BLUZ'), - (4307450, 'LFERNAN'), - (4307500, 'LFERNAN'), - (4307559, 'LFERNAN'), - (4307609, 'JBGOIS'), - (4307708, 'JBGOIS'), - (4307807, 'MARGARET'), - (4307815, 'MARGARET'), - (4307831, 'LFERNAN'), - (4307864, 'BLUZ'), - (4307906, 'BLUZ'), - (4308003, 'janarycn'), - (4308052, 'LFERNAN'), - (4308078, 'MARGARET'), - (4308102, 'JBGOIS'), - (4308201, 'BLUZ'), - (4308250, 'LFERNAN'), - (4308300, 'LFERNAN'), - (4308409, 'janarycn'), - (4308433, 'MARGARET'), - (4308458, 'LFERNAN'), - (4308508, 'LFERNAN'), - (4308607, 'BLUZ'), - (4308656, 'RAFAHLS'), - (4308706, 'LFERNAN'), - (4308805, 'JBGOIS'), - (4308854, 'LFERNAN'), - (4308904, 'LFERNAN'), - (4309001, 'LFERNAN'), - (4309050, 'JBGOIS'), - (4309100, 'JBGOIS'), - (4309126, 'LFERNAN'), - (4309159, 'MARGARET'), - (4309209, 'JBGOIS'), - (4309258, 'BLUZ'), - (4309308, 'JBGOIS'), - (4309407, 'BLUZ'), - (4309506, 'LFERNAN'), - (4309555, 'JBGOIS'), - (4307104, 'JBGOIS'), - (4309571, 'MARGARET'), - (4309605, 'LFERNAN'), - (4309654, 'RAFAHLS'), - (4309704, 'LFERNAN'), - (4309753, 'MARGARET'), - (4309803, 'LFERNAN'), - (4309902, 'LFERNAN'), - (4309951, 'LFERNAN'), - (4310009, 'LFERNAN'), - (4310108, 'JBGOIS'), - (4310207, 'LFERNAN'), - (4310306, 'BLUZ'), - (4310330, 'JBGOIS'), - (4310363, 'MARGARET'), - (4310405, 'LFERNAN'), - (4310413, 'LFERNAN'), - (4310439, 'BLUZ'), - (4310462, 'LFERNAN'), - (4310504, 'LFERNAN'), - (4310538, 'janarycn'), - (4310553, 'janarycn'), - (4310579, 'BLUZ'), - (4310603, 'RAFAHLS'), - (4310652, 'JBGOIS'), - (4310702, 'LFERNAN'), - (4310751, 'janarycn'), - (4310801, 'JBGOIS'), - (4310850, 'LFERNAN'), - (4310876, 'LFERNAN'), - (4310900, 'LFERNAN'), - (4311007, 'JBGOIS'), - (4311106, 'janarycn'), - (4311122, 'BLUZ'), - (4311130, 'janarycn'), - (4311155, 'LFERNAN'), - (4311205, 'janarycn'), - (4311239, 'MARGARET'), - (4311270, 'LFERNAN'), - (4311304, 'BLUZ'), - (4311254, 'LFERNAN'), - (4311403, 'MARGARET'), - (4311429, 'LFERNAN'), - (4311502, 'RAFAHLS'), - (4311601, 'LFERNAN'), - (4311627, 'JBGOIS'), - (4311643, 'JBGOIS'), - (4311718, 'RAFAHLS'), - (4311700, 'LFERNAN'), - (4311734, 'JBGOIS'), - (4311759, 'RAFAHLS'), - (4311775, 'JBGOIS'), - (4311791, 'JBGOIS'), - (4311809, 'LFERNAN'), - (4311908, 'LFERNAN'), - (4311981, 'JBGOIS'), - (4312005, 'LFERNAN'), - (4312054, 'MARGARET'), - (4312104, 'janarycn'), - (4312138, 'LFERNAN'), - (4312153, 'MARGARET'), - (4312179, 'LFERNAN'), - (4312203, 'LFERNAN'), - (4312252, 'JBGOIS'), - (4312302, 'LFERNAN'), - (4312351, 'BLUZ'), - (4312377, 'BLUZ'), - (4312385, 'BLUZ'), - (4312401, 'JBGOIS'), - (4312427, 'LFERNAN'), - (4312443, 'JBGOIS'), - (4312450, 'JBGOIS'), - (4312476, 'JBGOIS'), - (4312500, 'JBGOIS'), - (4312609, 'MARGARET'), - (4312617, 'BLUZ'), - (4312625, 'LFERNAN'), - (4312658, 'LFERNAN'), - (4312674, 'LFERNAN'), - (4312708, 'LFERNAN'), - (4312757, 'BLUZ'), - (4312807, 'BLUZ'), - (4312906, 'BLUZ'), - (4312955, 'LFERNAN'), - (4313003, 'MARGARET'), - (4313011, 'LFERNAN'), - (4313037, 'janarycn'), - (4313060, 'JBGOIS'), - (4313086, 'BLUZ'), - (4313102, 'janarycn'), - (4313201, 'JBGOIS'), - (4313300, 'BLUZ'), - (4313334, 'LFERNAN'), - (4313359, 'BLUZ'), - (4313375, 'JBGOIS'), - (4313490, 'LFERNAN'), - (4313391, 'MARGARET'), - (4313409, 'JBGOIS'), - (4313425, 'LFERNAN'), - (4313441, 'LFERNAN'), - (4313466, 'LFERNAN'), - (4313508, 'JBGOIS'), - (4313607, 'LFERNAN'), - (4313656, 'JBGOIS'), - (4313706, 'LFERNAN'), - (4313805, 'LFERNAN'), - (4313904, 'LFERNAN'), - (4313953, 'MARGARET'), - (4314001, 'BLUZ'), - (4314027, 'MARGARET'), - (4314035, 'JBGOIS'), - (4314050, 'JBGOIS'), - (4314068, 'MARGARET'), - (4314076, 'MARGARET'), - (4314100, 'LFERNAN'), - (4314134, 'LFERNAN'), - (4314159, 'MARGARET'), - (4314175, 'JBGOIS'), - (4314209, 'JBGOIS'), - (4314308, 'LFERNAN'), - (4314407, 'JBGOIS'), - (4314423, 'JBGOIS'), - (4314456, 'LFERNAN'), - (4314464, 'BLUZ'), - (4314472, 'janarycn'), - (4314498, 'LFERNAN'), - (4314506, 'JBGOIS'), - (4314548, 'BLUZ'), - (4314555, 'LFERNAN'), - (4314605, 'JBGOIS'), - (4314704, 'LFERNAN'), - (4314753, 'JBGOIS'), - (4314779, 'LFERNAN'), - (4314787, 'LFERNAN'), - (4314803, 'JBGOIS'), - (4314902, 'JBGOIS'), - (4315008, 'LFERNAN'), - (4315057, 'LFERNAN'), - (4315073, 'LFERNAN'), - (4315107, 'LFERNAN'), - (4315131, 'MARGARET'), - (4315149, 'JBGOIS'), - (4315156, 'MARGARET'), - (4315172, 'BLUZ'), - (4315206, 'BLUZ'), - (4315305, 'RAFAHLS'), - (4315313, 'LFERNAN'), - (4315321, 'janarycn'), - (4315354, 'LFERNAN'), - (4315404, 'LFERNAN'), - (4315453, 'MARGARET'), - (4315503, 'janarycn'), - (4315552, 'LFERNAN'), - (4315602, 'JBGOIS'), - (4315701, 'MARGARET'), - (4315750, 'JBGOIS'), - (4315800, 'MARGARET'), - (4315909, 'LFERNAN'), - (4315958, 'LFERNAN'), - (4316006, 'JBGOIS'), - (4316105, 'LFERNAN'), - (4316204, 'LFERNAN'), - (4316303, 'LFERNAN'), - (4316402, 'RAFAHLS'), - (4316428, 'LFERNAN'), - (4316436, 'LFERNAN'), - (4316451, 'LFERNAN'), - (4316477, 'LFERNAN'), - (4316501, 'JBGOIS'), - (4316600, 'LFERNAN'), - (4316709, 'LFERNAN'), - (4316733, 'LFERNAN'), - (4316758, 'MARGARET'), - (4316808, 'MARGARET'), - (4316972, 'RAFAHLS'), - (4316907, 'janarycn'), - (4316956, 'JBGOIS'), - (4317202, 'LFERNAN'), - (4317251, 'BLUZ'), - (4317301, 'JBGOIS'), - (4317004, 'JBGOIS'), - (4317103, 'RAFAHLS'), - (4317400, 'janarycn'), - (4317509, 'LFERNAN'), - (4317608, 'JBGOIS'), - (4317707, 'LFERNAN'), - (4317558, 'LFERNAN'), - (4317756, 'LFERNAN'), - (4317806, 'LFERNAN'), - (4317905, 'LFERNAN'), - (4317954, 'LFERNAN'), - (4318002, 'RAFAHLS'), - (4318051, 'LFERNAN'), - (4318101, 'RAFAHLS'), - (4318200, 'BLUZ'), - (4318309, 'RAFAHLS'), - (4318408, 'JBGOIS'), - (4318424, 'LFERNAN'), - (4318432, 'janarycn'), - (4318440, 'BLUZ'), - (4318457, 'LFERNAN'), - (4318465, 'LFERNAN'), - (4318481, 'JBGOIS'), - (4318499, 'LFERNAN'), - (4318507, 'JBGOIS'), - (4318606, 'LFERNAN'), - (4318614, 'JBGOIS'), - (4318622, 'BLUZ'), - (4318705, 'JBGOIS'), - (4318804, 'JBGOIS'), - (4318903, 'LFERNAN'), - (4319000, 'BLUZ'), - (4319109, 'LFERNAN'), - (4319125, 'janarycn'), - (4319158, 'LFERNAN'), - (4319208, 'LFERNAN'), - (4319307, 'LFERNAN'), - (4319356, 'JBGOIS'), - (4319364, 'LFERNAN'), - (4319372, 'LFERNAN'), - (4319406, 'janarycn'), - (4319505, 'JBGOIS'), - (4319604, 'janarycn'), - (4319703, 'LFERNAN'), - (4319711, 'BLUZ'), - (4319737, 'LFERNAN'), - (4319752, 'JBGOIS'), - (4319802, 'janarycn'), - (4319901, 'JBGOIS'), - (4320008, 'JBGOIS'), - (4320107, 'LFERNAN'), - (4320206, 'LFERNAN'), - (4320230, 'LFERNAN'), - (4320263, 'MARGARET'), - (4320305, 'LFERNAN'), - (4320321, 'LFERNAN'), - (4320354, 'JBGOIS'), - (4320404, 'BLUZ'), - (4320453, 'MARGARET'), - (4320503, 'LFERNAN'), - (4320552, 'JBGOIS'), - (4320578, 'LFERNAN'), - (4320602, 'LFERNAN'), - (4320651, 'janarycn'), - (4320677, 'MARGARET'), - (4320701, 'MARGARET'), - (4320800, 'LFERNAN'), - (4320859, 'MARGARET'), - (4320909, 'LFERNAN'), - (4321006, 'LFERNAN'), - (4321105, 'JBGOIS'), - (4321204, 'JBGOIS'), - (4321303, 'MARGARET'), - (4321329, 'LFERNAN'), - (4321352, 'JBGOIS'), - (4321402, 'LFERNAN'), - (4321436, 'JBGOIS'), - (4321451, 'MARGARET'), - (4321469, 'LFERNAN'), - (4321477, 'LFERNAN'), - (4321493, 'janarycn'), - (4321501, 'JBGOIS'), - (4321600, 'JBGOIS'), - (4321626, 'MARGARET'), - (4321634, 'LFERNAN'), - (4321667, 'JBGOIS'), - (4321709, 'JBGOIS'), - (4321808, 'LFERNAN'), - (4321832, 'JBGOIS'), - (4321857, 'LFERNAN'), - (4321907, 'LFERNAN'), - (4321956, 'LFERNAN'), - (4322004, 'JBGOIS'), - (4322103, 'LFERNAN'), - (4322152, 'LFERNAN'), - (4322186, 'LFERNAN'), - (4322202, 'janarycn'), - (4322251, 'JBGOIS'), - (4322301, 'LFERNAN'), - (4322327, 'JBGOIS'), - (4322343, 'LFERNAN'), - (4322350, 'BLUZ'), - (4322376, 'janarycn'), - (4322400, 'RAFAHLS'), - (4322509, 'BLUZ'), - (4322533, 'MARGARET'), - (4322541, 'JBGOIS'), - (4322525, 'JBGOIS'), - (4322558, 'LFERNAN'), - (4322608, 'MARGARET'), - (4322707, 'MARGARET'), - (4322806, 'BLUZ'), - (4322855, 'MARGARET'), - (4322905, 'LFERNAN'), - (4323002, 'JBGOIS'), - (4323101, 'LFERNAN'), - (4323200, 'LFERNAN'), - (4323309, 'BLUZ'), - (4323358, 'LFERNAN'), - (4323408, 'LFERNAN'), - (4323457, 'janarycn'), - (4323507, 'LFERNAN'), - (4323606, 'BLUZ'), - (4323705, 'LFERNAN'), - (4323754, 'LFERNAN'), - (4323770, 'MARGARET'), - (4323804, 'JBGOIS'), - (5000203, 'pillarap'), - (5000252, 'LFERNAN'), - (5000609, 'PATI'), - (5000708, 'ADAL'), - (5000807, 'pillarap'), - (5000856, 'PATI'), - (5000906, 'PATI'), - (5001003, 'pillarap'), - (5001102, 'ADAL'), - (5001243, 'PATI'), - (5001508, 'LFERNAN'), - (5001904, 'pillarap'), - (5002001, 'pillarap'), - (5002100, 'PATI'), - (5002159, 'PATI'), - (5002209, 'PATI'), - (5002308, 'pillarap'), - (5002407, 'PATI'), - (5002605, 'LFERNAN'), - (5002704, 'LFERNAN'), - (5002803, 'PATI'), - (5002902, 'pillarap'), - (5002951, 'pillarap'), - (5003108, 'LFERNAN'), - (5003157, 'PATI'), - (5003207, 'ADAL'), - (5003256, 'pillarap'), - (5003306, 'LFERNAN'), - (5003454, 'PATI'), - (5003488, 'ADAL'), - (5003504, 'PATI'), - (5003702, 'PATI'), - (5003751, 'PATI'), - (5003801, 'PATI'), - (5003900, 'LFERNAN'), - (5004007, 'PATI'), - (5004106, 'PATI'), - (5004304, 'PATI'), - (5004403, 'pillarap'), - (5004502, 'PATI'), - (5004601, 'PATI'), - (5004700, 'PATI'), - (5004809, 'PATI'), - (5004908, 'LFERNAN'), - (5005004, 'PATI'), - (5005103, 'PATI'), - (5005152, 'PATI'), - (5005202, 'ADAL'), - (5005251, 'PATI'), - (5005400, 'PATI'), - (5005608, 'ADAL'), - (5005681, 'PATI'), - (5005707, 'PATI'), - (5005806, 'PATI'), - (5006002, 'PATI'), - (5006200, 'pillarap'), - (5006259, 'PATI'), - (5006275, 'pillarap'), - (5006309, 'pillarap'), - (5006358, 'PATI'), - (5006408, 'LFERNAN'), - (5006606, 'PATI'), - (5006903, 'ADAL'), - (5007109, 'pillarap'), - (5007208, 'PATI'), - (5007307, 'LFERNAN'), - (5007406, 'LFERNAN'), - (5007505, 'LFERNAN'), - (5007554, 'pillarap'), - (5007695, 'LFERNAN'), - (5007802, 'pillarap'), - (5007703, 'PATI'), - (5007901, 'LFERNAN'), - (5007935, 'LFERNAN'), - (5007950, 'PATI'), - (5007976, 'pillarap'), - (5008008, 'LFERNAN'), - (5008305, 'pillarap'), - (5008404, 'PATI'), - (5100102, 'JBGOIS'), - (5100201, 'LILIANE'), - (5100250, 'RONALDL'), - (5100300, 'TELMAV'), - (5100359, 'LILIANE'), - (5100409, 'TELMAV'), - (5100508, 'JBGOIS'), - (5100607, 'TELMAV'), - (5100805, 'RONALDL'), - (5101001, 'LILIANE'), - (5101209, 'TELMAV'), - (5101258, 'BLUZ'), - (5101308, 'JBGOIS'), - (5101407, 'RONALDL'), - (5101605, 'JBGOIS'), - (5101704, 'BLUZ'), - (5101803, 'LILIANE'), - (5101852, 'LILIANE'), - (5101902, 'RONALDL'), - (5102504, 'JBGOIS'), - (5102603, 'LILIANE'), - (5102637, 'RONALDL'), - (5102678, 'TELMAV'), - (5102686, 'RONALDL'), - (5102694, 'LILIANE'), - (5102702, 'LILIANE'), - (5102793, 'RONALDL'), - (5102850, 'RONALDL'), - (5103007, 'JBGOIS'), - (5103056, 'RONALDL'), - (5103106, 'LILIANE'), - (5103205, 'RONALDL'), - (5103254, 'RONALDL'), - (5103304, 'RONALDL'), - (5103353, 'LILIANE'), - (5103361, 'BLUZ'), - (5103379, 'RONALDL'), - (5103403, 'JBGOIS'), - (5103437, 'JBGOIS'), - (5103452, 'BLUZ'), - (5103502, 'RONALDL'), - (5103601, 'TELMAV'), - (5103700, 'RONALDL'), - (5103809, 'BLUZ'), - (5103858, 'RONALDL'), - (5103908, 'TELMAV'), - (5103957, 'BLUZ'), - (5104104, 'RONALDL'), - (5104203, 'TELMAV'), - (5104500, 'BLUZ'), - (5104526, 'RONALDL'), - (5104542, 'RONALDL'), - (5104559, 'RONALDL'), - (5104609, 'TELMAV'), - (5104807, 'TELMAV'), - (5104906, 'JBGOIS'), - (5105002, 'BLUZ'), - (5105101, 'RONALDL'), - (5105150, 'RONALDL'), - (5105176, 'RONALDL'), - (5105200, 'TELMAV'), - (5105234, 'BLUZ'), - (5105259, 'RONALDL'), - (5105309, 'LILIANE'), - (5105580, 'RONALDL'), - (5105606, 'RONALDL'), - (5105622, 'BLUZ'), - (5105903, 'RONALDL'), - (5106000, 'JBGOIS'), - (5106109, 'JBGOIS'), - (5106158, 'RONALDL'), - (5106208, 'RONALDL'), - (5106216, 'RONALDL'), - (5108808, 'RONALDL'), - (5106182, 'BLUZ'), - (5108857, 'JBGOIS'), - (5108907, 'RONALDL'), - (5108956, 'RONALDL'), - (5106224, 'RONALDL'), - (5106174, 'LILIANE'), - (5106232, 'BLUZ'), - (5106190, 'RONALDL'), - (5106240, 'RONALDL'), - (5106257, 'LILIANE'), - (5106273, 'RONALDL'), - (5106265, 'RONALDL'), - (5106315, 'LILIANE'), - (5106281, 'LILIANE'), - (5106299, 'RONALDL'), - (5106307, 'RONALDL'), - (5106372, 'TELMAV'), - (5106422, 'RONALDL'), - (5106455, 'RONALDL'), - (5106505, 'JBGOIS'), - (5106653, 'TELMAV'), - (5106703, 'TELMAV'), - (5106752, 'BLUZ'), - (5106778, 'LILIANE'), - (5106802, 'RONALDL'), - (5106828, 'BLUZ'), - (5106851, 'BLUZ'), - (5107008, 'TELMAV'), - (5107040, 'TELMAV'), - (5107065, 'LILIANE'), - (5107156, 'BLUZ'), - (5107180, 'LILIANE'), - (5107198, 'TELMAV'), - (5107206, 'BLUZ'), - (5107578, 'RONALDL'), - (5107602, 'TELMAV'), - (5107701, 'JBGOIS'), - (5107750, 'BLUZ'), - (5107248, 'RONALDL'), - (5107743, 'LILIANE'), - (5107768, 'RONALDL'), - (5107776, 'LILIANE'), - (5107263, 'JBGOIS'), - (5107792, 'LILIANE'), - (5107800, 'JBGOIS'), - (5107859, 'LILIANE'), - (5107297, 'TELMAV'), - (5107305, 'RONALDL'), - (5107354, 'LILIANE'), - (5107107, 'BLUZ'), - (5107404, 'TELMAV'), - (5107875, 'RONALDL'), - (5107883, 'LILIANE'), - (5107909, 'RONALDL'), - (5107925, 'RONALDL'), - (5107941, 'RONALDL'), - (5107958, 'BLUZ'), - (5108006, 'RONALDL'), - (5108055, 'RONALDL'), - (5108105, 'TELMAV'), - (5108204, 'TELMAV'), - (5108303, 'RONALDL'), - (5108352, 'BLUZ'), - (5108402, 'JBGOIS'), - (5108501, 'RONALDL'), - (5105507, 'BLUZ'), - (5108600, 'LILIANE'), - (5200050, 'MARGARET'), - (5200100, 'RAFAHLS'), - (5200134, 'robsoner'), - (5200159, 'MARGARET'), - (5200175, 'RAFAHLS'), - (5200209, 'robsoner'), - (5200258, 'RAFAHLS'), - (5200308, 'RAFAHLS'), - (5200506, 'robsoner'), - (5200555, 'OTTO'), - (5200605, 'OTTO'), - (5200803, 'RAFAHLS'), - (5200829, 'OTTO'), - (5200852, 'MARGARET'), - (5200902, 'MARGARET'), - (5201108, 'MARGARET'), - (5201207, 'robsoner'), - (5201306, 'MARGARET'), - (5201405, 'MARGARET'), - (5201454, 'robsoner'), - (5201504, 'robsoner'), - (5201603, 'MARGARET'), - (5201702, 'janarycn'), - (5201801, 'MARGARET'), - (5202155, 'janarycn'), - (5202353, 'janarycn'), - (5202502, 'janarycn'), - (5202601, 'MARGARET'), - (5202809, 'MARGARET'), - (5203104, 'janarycn'), - (5203203, 'MARGARET'), - (5203302, 'MARGARET'), - (5203401, 'janarycn'), - (5203500, 'robsoner'), - (5203559, 'MARGARET'), - (5203575, 'OTTO'), - (5203609, 'MARGARET'), - (5203807, 'janarycn'), - (5203906, 'robsoner'), - (5203939, 'MARGARET'), - (5203962, 'RAFAHLS'), - (5204003, 'RAFAHLS'), - (5204102, 'robsoner'), - (5204201, 'MARGARET'), - (5204250, 'robsoner'), - (5204300, 'robsoner'), - (5204409, 'robsoner'), - (5204508, 'robsoner'), - (5204557, 'MARGARET'), - (5204607, 'robsoner'), - (5204656, 'OTTO'), - (5204706, 'OTTO'), - (5204805, 'robsoner'), - (5204854, 'MARGARET'), - (5204904, 'OTTO'), - (5204953, 'OTTO'), - (5205000, 'MARGARET'), - (5205059, 'robsoner'), - (5205109, 'robsoner'), - (5205208, 'MARGARET'), - (5205307, 'OTTO'), - (5205406, 'MARGARET'), - (5205455, 'robsoner'), - (5205471, 'robsoner'), - (5205497, 'RAFAHLS'), - (5205513, 'RAFAHLS'), - (5205521, 'OTTO'), - (5205703, 'MARGARET'), - (5205802, 'RAFAHLS'), - (5205901, 'robsoner'), - (5206206, 'RAFAHLS'), - (5206305, 'robsoner'), - (5206404, 'janarycn'), - (5206503, 'robsoner'), - (5206602, 'robsoner'), - (5206701, 'RAFAHLS'), - (5206800, 'MARGARET'), - (5206909, 'robsoner'), - (5207105, 'janarycn'), - (5208301, 'RAFAHLS'), - (5207253, 'robsoner'), - (5207352, 'robsoner'), - (5207402, 'robsoner'), - (5207501, 'OTTO'), - (5207535, 'janarycn'), - (5207600, 'MARGARET'), - (5207808, 'MARGARET'), - (5207907, 'RAFAHLS'), - (5208004, 'RAFAHLS'), - (5208103, 'OTTO'), - (5208152, 'robsoner'), - (5208400, 'MARGARET'), - (5208509, 'robsoner'), - (5208608, 'MARGARET'), - (5208707, 'MARGARET'), - (5208806, 'MARGARET'), - (5208905, 'janarycn'), - (5209101, 'robsoner'), - (5209150, 'robsoner'), - (5209200, 'MARGARET'), - (5209291, 'MARGARET'), - (5209408, 'RAFAHLS'), - (5209457, 'MARGARET'), - (5209606, 'MARGARET'), - (5209705, 'MARGARET'), - (5209804, 'MARGARET'), - (5209903, 'RAFAHLS'), - (5209937, 'robsoner'), - (5209952, 'robsoner'), - (5210000, 'MARGARET'), - (5210109, 'robsoner'), - (5210158, 'MARGARET'), - (5210208, 'MARGARET'), - (5210307, 'MARGARET'), - (5210406, 'MARGARET'), - (5210562, 'MARGARET'), - (5210604, 'MARGARET'), - (5210802, 'robsoner'), - (5210901, 'MARGARET'), - (5211008, 'janarycn'), - (5211206, 'MARGARET'), - (5211305, 'robsoner'), - (5211404, 'MARGARET'), - (5211503, 'robsoner'), - (5211602, 'MARGARET'), - (5211701, 'robsoner'), - (5211800, 'MARGARET'), - (5211909, 'robsoner'), - (5212006, 'MARGARET'), - (5212055, 'MARGARET'), - (5212105, 'robsoner'), - (5212204, 'janarycn'), - (5212253, 'robsoner'), - (5212303, 'MARGARET'), - (5212501, 'RAFAHLS'), - (5212600, 'robsoner'), - (5212709, 'RAFAHLS'), - (5212808, 'OTTO'), - (5212907, 'robsoner'), - (5212956, 'janarycn'), - (5213004, 'robsoner'), - (5213053, 'RAFAHLS'), - (5213087, 'OTTO'), - (5213103, 'robsoner'), - (5213400, 'MARGARET'), - (5213509, 'OTTO'), - (5213707, 'janarycn'), - (5213756, 'robsoner'), - (5213772, 'OTTO'), - (5213806, 'robsoner'), - (5213855, 'MARGARET'), - (5213905, 'MARGARET'), - (5214002, 'janarycn'), - (5214051, 'janarycn'), - (5214101, 'OTTO'), - (5214408, 'MARGARET'), - (5214507, 'MARGARET'), - (5214606, 'OTTO'), - (5214705, 'MARGARET'), - (5214804, 'robsoner'), - (5214838, 'janarycn'), - (5214861, 'MARGARET'), - (5214879, 'OTTO'), - (5214903, 'OTTO'), - (5215009, 'MARGARET'), - (5215207, 'MARGARET'), - (5215231, 'RAFAHLS'), - (5215256, 'janarycn'), - (5215306, 'robsoner'), - (5215405, 'MARGARET'), - (5215504, 'robsoner'), - (5215603, 'RAFAHLS'), - (5215652, 'robsoner'), - (5215702, 'robsoner'), - (5215801, 'robsoner'), - (5215900, 'robsoner'), - (5216007, 'robsoner'), - (5216304, 'robsoner'), - (5216403, 'robsoner'), - (5216452, 'robsoner'), - (5216809, 'MARGARET'), - (5216908, 'MARGARET'), - (5217104, 'robsoner'), - (5217203, 'janarycn'), - (5217302, 'RAFAHLS'), - (5217401, 'robsoner'), - (5217609, 'RAFAHLS'), - (5217708, 'robsoner'), - (5218003, 'OTTO'), - (5218052, 'robsoner'), - (5218102, 'robsoner'), - (5218300, 'RAFAHLS'), - (5218391, 'robsoner'), - (5218508, 'robsoner'), - (5218607, 'MARGARET'), - (5218706, 'MARGARET'), - (5218789, 'robsoner'), - (5218805, 'robsoner'), - (5218904, 'MARGARET'), - (5219001, 'MARGARET'), - (5219100, 'MARGARET'), - (5219209, 'robsoner'), - (5219258, 'janarycn'), - (5219308, 'robsoner'), - (5219357, 'MARGARET'), - (5219407, 'robsoner'), - (5219456, 'MARGARET'), - (5219506, 'MARGARET'), - (5219605, 'OTTO'), - (5219704, 'OTTO'), - (5219712, 'robsoner'), - (5219738, 'MARGARET'), - (5219753, 'RAFAHLS'), - (5219803, 'RAFAHLS'), - (5219902, 'MARGARET'), - (5220058, 'robsoner'), - (5220009, 'OTTO'), - (5220108, 'MARGARET'), - (5220157, 'MARGARET'), - (5220207, 'janarycn'), - (5220264, 'robsoner'), - (5220280, 'MARGARET'), - (5220405, 'robsoner'), - (5220454, 'MARGARET'), - (5220504, 'robsoner'), - (5220603, 'robsoner'), - (5220686, 'RAFAHLS'), - (5220702, 'RAFAHLS'), - (5221007, 'MARGARET'), - (5221080, 'OTTO'), - (5221197, 'MARGARET'), - (5221304, 'robsoner'), - (5221403, 'MARGARET'), - (5221452, 'OTTO'), - (5221502, 'MARGARET'), - (5221551, 'robsoner'), - (5221577, 'janarycn'), - (5221601, 'OTTO'), - (5221700, 'MARGARET'), - (5221809, 'robsoner'), - (5221858, 'RAFAHLS'), - (5221908, 'robsoner'), - (5222005, 'robsoner'), - (5222054, 'robsoner'), - (5222203, 'RAFAHLS'), - (5222302, 'RAFAHLS'), -] diff --git a/scripts/setgerentes/set_gerentes.py b/scripts/setgerentes/set_gerentes.py deleted file mode 100644 index acefe07..0000000 --- a/scripts/setgerentes/set_gerentes.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -from dados_gerentes import atrib, gerentes -from sigi.apps.casas.models import CasaLegislativa - - -def salvar(): - for cod, abrev_gerente in atrib: - casas = CasaLegislativa.objects.filter(municipio__codigo_ibge=cod, tipo__sigla='CM') - if not casas: - print '############################# SEM CASA: ', cod - elif len(casas) > 1: - print '############################# VÁRIAS CASAS: ', cod, casas - else: - [c] = casas - c.gerente_contas = gerentes[abrev_gerente] - c.save() diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index e84c73e..08b90f1 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -56,6 +56,7 @@ class FuncionariosInline(admin.StackedInline): ('nota', 'email'), ('cargo', 'funcao', 'setor'), ('tempo_de_servico', 'ult_alteracao'), + ('desativado', 'observacoes'), ) }),) readonly_fields = ('ult_alteracao',) @@ -63,44 +64,75 @@ class FuncionariosInline(admin.StackedInline): inlines = (TelefonesInline,) def get_queryset(self, request): - return self.model.objects.exclude(cargo=_(u"Presidente")) + return (self.model.objects.exclude( + cargo='Presidente').exclude(desativado=True) + ) -class ConveniosInline(admin.StackedInline): +class ConveniosInline(admin.TabularInline): model = Convenio fieldsets = ( - (None, {'fields': (('link_convenio', 'num_processo_sf', 'num_convenio', 'projeto', 'observacao'), - ('data_adesao', 'data_retorno_assinatura', 'data_termo_aceite', 'data_pub_diario', 'data_devolucao_via', 'data_postagem_correio'), - ('data_devolucao_sem_assinatura', 'data_retorno_sem_assinatura',), - ('get_tramitacoes', 'get_anexos', 'get_equipamentos',), - )} - ), + (None, {'fields': ( + ('link_sigad', 'status_convenio', 'num_convenio', + 'projeto', 'observacao'), + ('data_adesao', 'data_retorno_assinatura', 'data_termo_aceite', + 'data_pub_diario', 'data_devolucao_via', 'data_postagem_correio'), + ('data_devolucao_sem_assinatura', 'data_retorno_sem_assinatura',), + ('link_convenio',), + )}), ) - readonly_fields = ['get_tramitacoes', 'get_anexos', 'get_equipamentos', 'link_convenio', ] + readonly_fields = ['link_convenio', 'link_sigad', 'status_convenio', + 'num_convenio', 'projeto', 'observacao', 'data_adesao', + 'data_retorno_assinatura', 'data_termo_aceite', + 'data_pub_diario', 'data_devolucao_via', + 'data_postagem_correio', 'data_devolucao_sem_assinatura', + 'data_retorno_sem_assinatura',] extra = 0 - - def get_tramitacoes(self, obj): - return '
    '.join([t.__unicode__() for t in obj.tramitacao_set.all()]) - - get_tramitacoes.short_description = _(u'Tramitações') - get_tramitacoes.allow_tags = True - - def get_anexos(self, obj): - return '
    '.join(['%s' % (a.arquivo.url, a.__unicode__()) for a in obj.anexo_set.all()]) - - get_anexos.short_description = _(u'Anexos') - get_anexos.allow_tags = True - - def get_equipamentos(self, obj): - return '
    '.join([e.__unicode__() for e in obj.equipamentoprevisto_set.all()]) - - get_equipamentos.short_description = _(u'Equipamentos previstos') - get_equipamentos.allow_tags = True + can_delete = False + + def has_add_permission(self, request): + return False + +# def get_tramitacoes(self, obj): +# return '
    '.join([t.__unicode__() for t in obj.tramitacao_set.all()]) +# +# get_tramitacoes.short_description = _(u'Tramitações') +# get_tramitacoes.allow_tags = True +# +# def get_anexos(self, obj): +# return '
    '.join(['%s' % (a.arquivo.url, a.__unicode__()) for a in obj.anexo_set.all()]) +# +# get_anexos.short_description = _(u'Anexos') +# get_anexos.allow_tags = True +# +# def get_equipamentos(self, obj): +# return '
    '.join([e.__unicode__() for e in obj.equipamentoprevisto_set.all()]) +# +# get_equipamentos.short_description = _(u'Equipamentos previstos') +# get_equipamentos.allow_tags = True + + def status_convenio(self, obj): + if obj.pk is None: + return "" + status = obj.get_status() + + if status in [u"Vencido", u"Desistência"]: + label = r"danger" + elif status == u"Vigente": + label = r"success" + elif status == u"Pendente": + label = r"warning" + else: + label = r"info" + + return u'

    {status}

    '.format(label=label, status=status) + status_convenio.short_description = _(u"Status do convênio") + status_convenio.allow_tags = True + def link_convenio(self, obj): if obj.pk is None: return "" - from django.core.urlresolvers import reverse url = reverse('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.module_name), args=[obj.pk]) url = url + '?_popup=1' return """ @@ -110,6 +142,14 @@ class ConveniosInline(admin.StackedInline): link_convenio.short_description = _(u'Editar convenio') link_convenio.allow_tags = True + + def link_sigad(self, obj): + if obj.pk is None: + return "" + return obj.get_sigad_url() + + link_sigad.short_description = _("Processo no Senado") + link_sigad.allow_tags = True class LegislaturaInline(admin.TabularInline): @@ -191,10 +231,10 @@ class OcorrenciaInline(admin.TabularInline): link_editar.allow_tags = True -class GerentesContasFilter(admin.filters.RelatedFieldListFilter): +class GerentesInterlegisFilter(admin.filters.RelatedFieldListFilter): def __init__(self, *args, **kwargs): - super(GerentesContasFilter, self).__init__(*args, **kwargs) + super(GerentesInterlegisFilter, self).__init__(*args, **kwargs) gerentes = Servidor.objects.filter(casas_que_gerencia__isnull=False).order_by('nome_completo').distinct() self.lookup_choices = [(x.id, x) for x in gerentes] @@ -259,29 +299,33 @@ class ServicoFilter(admin.SimpleListFilter): class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): form = CasaLegislativaForm actions = ['adicionar_casas', ] - inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, ConveniosInline, LegislaturaInline, - DiagnosticoInline, BemInline, ServicoInline, PlanoDiretorInline, OcorrenciaInline,) - list_display = ('nome', 'get_uf', 'get_gerente_contas', 'get_convenios', + inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, + ConveniosInline, LegislaturaInline, DiagnosticoInline, BemInline, + ServicoInline, PlanoDiretorInline, OcorrenciaInline,) + list_display = ('nome', 'get_uf', 'get_gerentes', 'get_convenios', 'get_servicos') list_display_links = ('nome',) - list_filter = ('tipo', ('gerente_contas', GerentesContasFilter), + list_filter = ('tipo', ('gerentes_interlegis', GerentesInterlegisFilter), 'municipio__uf__nome', ConvenioFilter, ServicoFilter, 'inclusao_digital',) ordering = ('municipio__uf__nome', 'nome') queryset = queryset_ascii fieldsets = ( (None, { - 'fields': ('tipo', 'nome', 'cnpj', 'num_parlamentares', 'gerente_contas') + 'fields': ('tipo', 'nome', 'cnpj', 'num_parlamentares', + 'gerentes_interlegis') }), (_(u'Endereço'), { 'fields': ('data_instalacao', 'logradouro', 'bairro', 'municipio', 'cep', 'ult_alt_endereco'), }), (_(u'Presença na Internet'), { - 'fields': ('inclusao_digital', 'data_levantamento', 'pesquisador', 'pagina_web', 'email', 'obs_pesquisa',) + 'fields': ('inclusao_digital', 'data_levantamento', 'pesquisador', + 'pagina_web', 'email', 'obs_pesquisa',) }), (_(u'Outras informações'), { - 'fields': ('observacoes', 'horario_funcionamento', 'foto', 'recorte'), + 'fields': ('observacoes', 'horario_funcionamento', 'foto', + 'recorte'), }), ) raw_id_fields = ('municipio',) @@ -289,6 +333,7 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): search_fields = ('search_text', 'cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') + filter_horizontal = ('gerentes_interlegis',) def get_uf(self, obj): return obj.municipio.uf.nome @@ -296,10 +341,10 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): get_uf.short_description = _(u'Unidade da Federação') get_uf.admin_order_field = 'municipio__uf__nome' - def get_gerente_contas(self, obj): - return obj.gerente_contas - - get_gerente_contas.short_description = _(u'Gerente de contas') + def get_gerentes(self, obj): + return obj.lista_gerentes + get_gerentes.short_description = _(u'Gerente Interlegis') + get_gerentes.allow_tags = True def get_convenios(self, obj): return '
      ' + ''.join(['
    • %s
    • ' % c.__unicode__() for c in obj.convenio_set.all()]) + '
    ' diff --git a/sigi/apps/casas/forms.py b/sigi/apps/casas/forms.py index 2b87e5c..fcaf3a5 100644 --- a/sigi/apps/casas/forms.py +++ b/sigi/apps/casas/forms.py @@ -20,8 +20,22 @@ class CasaLegislativaForm(forms.ModelForm): fields = '__all__' class PortfolioForm(forms.Form): - gerente_contas = forms.ModelChoiceField(queryset=Servidor.objects.all(), label=_(u"Atribuir casas para")) + ACAO_CHOICES = ( + ('ADD', _(u"Adicionar")), + ('DEL', _(u"Remover")) + ) + acao = forms.ChoiceField( + label=_(u"Ação"), + choices=ACAO_CHOICES, + initial='ADD', + widget=forms.RadioSelect + ) + gerente = forms.ModelChoiceField( + queryset=Servidor.objects.all(), + label=_(u"Atribuir para") + ) - def __init__(self, label=_(u"Atribuir casas para"), *args, **kwargs): + # O label precisa ser trocado dependendo da região que se está visualizando + def __init__(self, label=_(u"Atribuir para"), *args, **kwargs): super(PortfolioForm, self).__init__(*args, **kwargs) - self.fields['gerente_contas'].label = label + self.fields['gerente'].label = label diff --git a/sigi/apps/casas/management/commands/importa_gerentes.py b/sigi/apps/casas/management/commands/importa_gerentes.py index f43744c..5994980 100644 --- a/sigi/apps/casas/management/commands/importa_gerentes.py +++ b/sigi/apps/casas/management/commands/importa_gerentes.py @@ -56,29 +56,43 @@ class Command(BaseCommand): if not self.campos.issubset(reader.fieldnames): raise CommandError(u"O arquivo não possui todos os campos obrigatórios") - CasaLegislativa.objects.update(gerente_contas=None) + CasaLegislativa.gerentes_interlegis.through.objects.all().delete() erros = 0 for reg in reader: try: - municipio = Municipio.objects.get(codigo_ibge=reg['cod_municipio']) + municipio = Municipio.objects.get( + codigo_ibge=reg['cod_municipio'] + ) except Municipio.DoesNotExist: - self.stdout.write(u"(Linha %s): não existe Município com código IBGE '%s'" % - (reader.line_num, reg['cod_municipio'],)) + self.stdout.write(u"{linha}: não existe Município com " + u"código IBGE {ibge}'".format( + linha=reader.line_num, + ibge=reg['cod_municipio']) + ) erros = erros + 1 continue try: - gerente = Servidor.objects.get(user__username=reg['user_id']) + gerente = Servidor.objects.get( + user__username=reg['user_id'] + ) except Servidor.DoesNotExist: - self.stdout.write(u"(Linha %s): não existe Servidor com userid '%s'" % - (reader.line_num, reg['user_id'],)) + self.stdout.write(u"({linha}): não existe Servidor com " + u"userid {userid}".format( + linha=reader.line_num, + userid=reg['user_id']) + ) erros = erros + 1 continue - for casa in municipio.casalegislativa_set.filter(tipo__sigla__in=['AL', 'CM']): - casa.gerente_contas = gerente + for casa in municipio.casalegislativa_set.filter( + tipo__sigla__in=['AL', 'CM']): + casa.gerentes_interlegis.add(gerente) casa.save() - self.stdout.write(u"Importação concluída. %s erros em %s linhas" % (erros, reader.line_num,)) \ No newline at end of file + self.stdout.write(u"Importação concluída. {erros} erros em {linhas}" + u" linhas".format(erros=erros, + linhas=reader.line_num) + ) \ No newline at end of file diff --git a/sigi/apps/casas/migrations/0004_auto_20201015_0810.py b/sigi/apps/casas/migrations/0004_auto_20201015_0810.py new file mode 100644 index 0000000..39f3463 --- /dev/null +++ b/sigi/apps/casas/migrations/0004_auto_20201015_0810.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0003_auto_20200207_0919'), + ] + + operations = [ + migrations.AlterField( + model_name='casalegislativa', + name='gerente_contas', + field=models.ForeignKey(related_name='casas_que_gerencia_old', verbose_name=b'Gerente de contas', blank=True, to='servidores.Servidor', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/migrations/0005_casalegislativa_gerentes_interlegis.py b/sigi/apps/casas/migrations/0005_casalegislativa_gerentes_interlegis.py new file mode 100644 index 0000000..56254f7 --- /dev/null +++ b/sigi/apps/casas/migrations/0005_casalegislativa_gerentes_interlegis.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0001_initial'), + ('casas', '0004_auto_20201015_0810'), + ] + + operations = [ + migrations.AddField( + model_name='casalegislativa', + name='gerentes_interlegis', + field=models.ManyToManyField(related_name='casas_que_gerencia', verbose_name=b'Gerentes Interlegis', to='servidores.Servidor'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/migrations/0006_remove_casalegislativa_gerente_contas.py b/sigi/apps/casas/migrations/0006_remove_casalegislativa_gerente_contas.py new file mode 100644 index 0000000..3d356eb --- /dev/null +++ b/sigi/apps/casas/migrations/0006_remove_casalegislativa_gerente_contas.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0005_casalegislativa_gerentes_interlegis'), + ] + + operations = [ + migrations.RemoveField( + model_name='casalegislativa', + name='gerente_contas', + ), + ] diff --git a/sigi/apps/casas/migrations/0007_auto_20201016_1632.py b/sigi/apps/casas/migrations/0007_auto_20201016_1632.py new file mode 100644 index 0000000..160bc5d --- /dev/null +++ b/sigi/apps/casas/migrations/0007_auto_20201016_1632.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0006_remove_casalegislativa_gerente_contas'), + ] + + operations = [ + migrations.AddField( + model_name='funcionario', + name='desativado', + field=models.BooleanField(default=False, verbose_name='Desativado'), + preserve_default=True, + ), + migrations.AddField( + model_name='funcionario', + name='observacoes', + field=models.TextField(verbose_name='Observa\xe7\xf5es', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='bairro', + field=models.CharField(max_length=100, verbose_name='Bairro', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='cep', + field=models.CharField(max_length=32, verbose_name='CEP'), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='codigo_interlegis', + field=models.CharField(max_length=3, verbose_name='C\xf3digo Interlegis', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='email', + field=models.EmailField(max_length=128, verbose_name='E-mail', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='foto', + field=models.ImageField(upload_to=b'imagens/casas', width_field=b'foto_largura', height_field=b'foto_altura', blank=True, verbose_name='Foto'), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='inclusao_digital', + field=models.CharField(default=b'NAO PESQUISADO', max_length=30, verbose_name='Inclus\xe3o digital', choices=[(b'NAO PESQUISADO', 'N\xe3o pesquisado'), (b'NAO POSSUI PORTAL', 'N\xe3o possui portal'), (b'PORTAL MODELO', 'Possui Portal Modelo'), (b'OUTRO PORTAL', 'Possui outro portal')]), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='logradouro', + field=models.CharField(help_text='Avenida, rua, pra\xe7a, jardim, parque...', max_length=100, verbose_name='Logradouro'), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='municipio', + field=models.ForeignKey(verbose_name='Munic\xedpio', to='contatos.Municipio'), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='nome', + field=models.CharField(help_text='Exemplo: C\xe2mara Municipal de Pains.', max_length=60, verbose_name='Nome'), + preserve_default=True, + ), + migrations.AlterField( + model_name='casalegislativa', + name='pagina_web', + field=models.URLField(help_text='Exemplo: http://www.camarapains.mg.gov.br.', verbose_name='P\xe1gina web', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='cargo', + field=models.CharField(max_length=100, null=True, verbose_name='Cargo', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='nota', + field=models.CharField(max_length=70, null=True, verbose_name='Telefones', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='setor', + field=models.CharField(default=b'outros', max_length=100, verbose_name='Setor', choices=[(b'presidente', 'Presidente'), (b'contato_interlegis', 'Contato Interlegis'), (b'infraestrutura_fisica', 'Infraestrutura F\xedsica'), (b'estrutura_de_ti', 'Estrutura de TI'), (b'organizacao_do_processo_legislativo', 'Organiza\xe7\xe3o do Processo Legislativo'), (b'producao_legislativa', 'Produ\xe7\xe3o Legislativa'), (b'estrutura_de_comunicacao_social', 'Estrutura de Comunica\xe7\xe3o Social'), (b'estrutura_de_recursos_humanos', 'Estrutura de Recursos Humanos'), (b'gestao', 'Gest\xe3o'), (b'outros', 'Outros')]), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='sexo', + field=models.CharField(default=b'M', max_length=1, verbose_name='Sexo', choices=[(b'M', 'Masculino'), (b'F', 'Feminino')]), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='tempo_de_servico', + field=models.CharField(max_length=50, null=True, verbose_name='Tempo de servi\xe7o', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='tipocasalegislativa', + name='nome', + field=models.CharField(max_length=100, verbose_name='Nome'), + preserve_default=True, + ), + migrations.AlterField( + model_name='tipocasalegislativa', + name='sigla', + field=models.CharField(max_length=5, verbose_name='Sigla'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 38f2138..d2366ee 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -3,7 +3,7 @@ from datetime import datetime import random from string import ascii_uppercase from unicodedata import normalize - +from django.utils.translation import ugettext as _ from django.contrib.contenttypes import generic from django.db import models from image_cropping import ImageRatioField @@ -20,12 +20,8 @@ class TipoCasaLegislativa(models.Model): Câmara Distrital ou Legislativo Federal """ - sigla = models.CharField( - max_length=5 - ) - nome = models.CharField( - max_length=100 - ) + sigla = models.CharField(_(u"Sigla"), max_length=5) + nome = models.CharField(_(u"Nome"), max_length=100) def __unicode__(self): return self.nome @@ -37,78 +33,126 @@ class CasaLegislativa(models.Model): """ INCLUSAO_DIGITAL_CHOICES = ( - ('NAO PESQUISADO', u'Não pesquisado'), - ('NAO POSSUI PORTAL', u'Não possui portal'), - ('PORTAL MODELO', u'Possui Portal Modelo'), - ('OUTRO PORTAL', u'Possui outro portal'), + ('NAO PESQUISADO', _(u'Não pesquisado')), + ('NAO POSSUI PORTAL', _(u'Não possui portal')), + ('PORTAL MODELO', _(u'Possui Portal Modelo')), + ('OUTRO PORTAL', _(u'Possui outro portal')), ) nome = models.CharField( + _(u"Nome"), max_length=60, - help_text='Exemplo: Câmara Municipal de Pains.' + help_text=_(u'Exemplo: Câmara Municipal de Pains.') ) # Guarda um campo para ser usado em buscas em caixa baixa e sem acento search_text = SearchField(field_names=['nome']) # search_text.projeto_filter = True - tipo = models.ForeignKey(TipoCasaLegislativa, verbose_name="Tipo") - cnpj = models.CharField('CNPJ', max_length=32, blank=True) - observacoes = models.TextField(u'observações', blank=True) + tipo = models.ForeignKey(TipoCasaLegislativa, verbose_name=_(u"Tipo")) + cnpj = models.CharField(_(u"CNPJ"), max_length=32, blank=True) + observacoes = models.TextField(_(u'observações'), blank=True) horario_funcionamento = models.CharField( - u"Horário de funcionamento da Casa Legislativa", + _(u"Horário de funcionamento da Casa Legislativa"), max_length=100, blank=True, ) # num_parlamentares = models.PositiveIntegerField('Número de parlamentares') - codigo_interlegis = models.CharField('Código Interlegis', max_length=3, blank=True) + codigo_interlegis = models.CharField( + _(u'Código Interlegis'), + max_length=3, + blank=True + ) # codigo_interlegis.ts_filter = True - - gerente_contas = models.ForeignKey(Servidor, verbose_name="Gerente de contas", null=True, blank=True, related_name='casas_que_gerencia') + + gerentes_interlegis = models.ManyToManyField( + Servidor, + verbose_name=_(u"Gerentes Interlegis"), + related_name='casas_que_gerencia' + ) # Informações de contato logradouro = models.CharField( + _(u"Logradouro"), max_length=100, - help_text='Avenida, rua, praça, jardim, parque...' + help_text=_(u'Avenida, rua, praça, jardim, parque...') ) - bairro = models.CharField(max_length=100, blank=True) + bairro = models.CharField(_(u"Bairro"), max_length=100, blank=True) municipio = models.ForeignKey( 'contatos.Municipio', - verbose_name='município' + verbose_name=_(u'Município') ) # municipio.uf_filter = True - cep = models.CharField(max_length=32) - email = models.EmailField('e-mail', max_length=128, blank=True) + cep = models.CharField(_(u"CEP"), max_length=32) + email = models.EmailField(_(u'E-mail'), max_length=128, blank=True) pagina_web = models.URLField( - u'página web', - help_text='Exemplo: http://www.camarapains.mg.gov.br.', + _(u'Página web'), + help_text=_(u'Exemplo: http://www.camarapains.mg.gov.br.'), blank=True, ) - inclusao_digital = models.CharField(max_length=30, choices=INCLUSAO_DIGITAL_CHOICES, default=INCLUSAO_DIGITAL_CHOICES[0][0]) - data_levantamento = models.DateTimeField(u"Data/hora da pesquisa", null=True, blank=True) - pesquisador = models.ForeignKey(Servidor, verbose_name=u"Pesquisador", null=True, blank=True) - obs_pesquisa = models.TextField(u"Observações do pesquisador", blank=True) - ult_alt_endereco = models.DateTimeField(u'Última alteração do endereço', null=True, blank=True, editable=True) + inclusao_digital = models.CharField( + _(u"Inclusão digital"), + max_length=30, + choices=INCLUSAO_DIGITAL_CHOICES, + default=INCLUSAO_DIGITAL_CHOICES[0][0] + ) + data_levantamento = models.DateTimeField( + _(u"Data/hora da pesquisa"), + null=True, + blank=True + ) + pesquisador = models.ForeignKey( + Servidor, + verbose_name=_(u"Pesquisador"), + null=True, + blank=True + ) + obs_pesquisa = models.TextField( + _(u"Observações do pesquisador"), + blank=True + ) + ult_alt_endereco = models.DateTimeField( + _(u'Última alteração do endereço'), + null=True, + blank=True, + editable=True + ) telefones = generic.GenericRelation('contatos.Telefone') foto = models.ImageField( + _(u"Foto"), upload_to='imagens/casas', width_field='foto_largura', height_field='foto_altura', blank=True ) - recorte = ImageRatioField('foto', '400x300', verbose_name="Recorte",) + recorte = ImageRatioField('foto', '400x300', verbose_name=_("Recorte")) foto_largura = models.SmallIntegerField(editable=False, null=True) foto_altura = models.SmallIntegerField(editable=False, null=True) - data_instalacao = models.DateField(u'Data de instalação da Casa Legislativa', null=True, blank=True) + data_instalacao = models.DateField( + _(u'Data de instalação da Casa Legislativa'), + null=True, + blank=True + ) class Meta: ordering = ('nome',) unique_together = ('municipio', 'tipo') - verbose_name = 'Casa Legislativa' - verbose_name_plural = 'Casas Legislativas' - + verbose_name = _(u'Casa Legislativa') + verbose_name_plural = _(u'Casas Legislativas') + + def lista_gerentes(self, fmt='html'): + if not self.gerentes_interlegis.exists(): + return "" + if fmt == 'html': + return u"
    • "+u"
    • ".join( + [g.nome_completo for g in self.gerentes_interlegis.all()])+\ + u"
    " + else: + return u", ".join([g.nome_completo for g in + self.gerentes_interlegis.all()]) + @property def num_parlamentares(self): if not self.legislatura_set.exists(): @@ -276,42 +320,79 @@ class Funcionario(models.Model): """ SETOR_CHOICES = [ - ("presidente", "Presidente"), - ("contato_interlegis", "Contato Interlegis"), - ("infraestrutura_fisica", "Infraestrutura Física"), - ("estrutura_de_ti", "Estrutura de TI"), - ("organizacao_do_processo_legislativo", "Organização do Processo Legislativo"), - ("producao_legislativa", "Produção Legislativa"), - ("estrutura_de_comunicacao_social", "Estrutura de Comunicação Social"), - ("estrutura_de_recursos_humanos", "Estrutura de Recursos Humanos"), - ("gestao", "Gestão"), - ("outros", "Outros"), + ("presidente", _(u"Presidente")), + ("contato_interlegis", _(u"Contato Interlegis")), + ("infraestrutura_fisica", _(u"Infraestrutura Física")), + ("estrutura_de_ti", _(u"Estrutura de TI")), + ("organizacao_do_processo_legislativo", + _(u"Organização do Processo Legislativo")), + ("producao_legislativa", _(u"Produção Legislativa")), + ("estrutura_de_comunicacao_social", + _(u"Estrutura de Comunicação Social")), + ("estrutura_de_recursos_humanos", _(u"Estrutura de Recursos Humanos")), + ("gestao", _(u"Gestão")), + ("outros", _(u"Outros")), ] SEXO_CHOICES = [ - ("M", "Masculino"), - ("F", "Feminino") + ("M", _(u"Masculino")), + ("F", _(u"Feminino")) ] casa_legislativa = models.ForeignKey(CasaLegislativa) - nome = models.CharField('nome completo', max_length=60, blank=False) + nome = models.CharField(_(u'nome completo'), max_length=60, blank=False) # nome.alphabetic_filter = True - sexo = models.CharField(max_length=1, choices=SEXO_CHOICES, default="M") - data_nascimento = models.DateField(u"Data de nascimento", blank=True, - null=True) - nota = models.CharField(max_length=70, null=True, blank=True) - email = models.CharField('e-mail', max_length=75, blank=True) - telefones = generic.GenericRelation('contatos.Telefone') + sexo = models.CharField( + _(u"Sexo"), + max_length=1, + choices=SEXO_CHOICES, + default="M" + ) + data_nascimento = models.DateField( + _(u"Data de nascimento"), + blank=True, + null=True + ) + nota = models.CharField( + _(u"Telefones"), + max_length=70, + null=True, + blank=True + ) + email = models.CharField(_(u'e-mail'), max_length=75, blank=True) endereco = generic.GenericRelation('contatos.Endereco') - cargo = models.CharField(max_length=100, null=True, blank=True) - funcao = models.CharField(u'função', max_length=100, null=True, blank=True) - setor = models.CharField(max_length=100, choices=SETOR_CHOICES, default="outros") - tempo_de_servico = models.CharField(u'tempo de serviço', max_length=50, null=True, blank=True) - ult_alteracao = models.DateTimeField(u'Última alteração', null=True, blank=True, editable=True, auto_now=True) + cargo = models.CharField(_(u"Cargo"), max_length=100, null=True, blank=True) + funcao = models.CharField( + _(u'função'), + max_length=100, + null=True, + blank=True + ) + setor = models.CharField( + _(u"Setor"), + max_length=100, + choices=SETOR_CHOICES, + default="outros" + ) + tempo_de_servico = models.CharField( + _(u'Tempo de serviço'), + max_length=50, + null=True, + blank=True + ) + ult_alteracao = models.DateTimeField( + _(u'Última alteração'), + null=True, + blank=True, + editable=True, + auto_now=True + ) + desativado = models.BooleanField(_(u"Desativado"), default=False) + observacoes = models.TextField(_(u"Observações"), blank=True) class Meta: ordering = ('nome',) - verbose_name = 'contato da Casa Legislativa' - verbose_name_plural = 'contatos da Casa Legislativa' + verbose_name = _(u'contato da Casa Legislativa') + verbose_name_plural = _(u'contatos da Casa Legislativa') def __unicode__(self): return self.nome diff --git a/sigi/apps/casas/templates/casas/portfolio.html b/sigi/apps/casas/templates/casas/portfolio.html index ab60d48..a3ad209 100644 --- a/sigi/apps/casas/templates/casas/portfolio.html +++ b/sigi/apps/casas/templates/casas/portfolio.html @@ -5,6 +5,32 @@ {% block extrastyle %} {{ block.super }} {% endblock %} @@ -22,10 +48,18 @@
    {{ e }}
    {% endfor %} + + @@ -34,7 +68,7 @@ @@ -44,7 +78,7 @@ @@ -54,7 +88,7 @@ @@ -64,7 +98,7 @@
    {% csrf_token %} {{ form }} - +
    {% endif %} @@ -85,7 +119,7 @@ {{ casa.municipio.uf }} {{ casa.municipio.microrregiao.mesorregiao }} {{ casa.municipio.microrregiao.nome }} - {{ casa.gerente_contas }} + {{ casa.lista_gerentes|safe }} {% endfor %} diff --git a/sigi/apps/casas/test_casas.py b/sigi/apps/casas/test_casas.py index 9e113c1..fe491ab 100644 --- a/sigi/apps/casas/test_casas.py +++ b/sigi/apps/casas/test_casas.py @@ -14,4 +14,4 @@ def some_parliaments(): def parliaments_from_names(names): - return [G(CasaLegislativa, nome=name, foto=None, gerente_contas=None,) for name in names] + return [G(CasaLegislativa, nome=name, foto=None,) for name in names] diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index eb74f54..18bd0f5 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -11,7 +11,7 @@ from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _, ungettext from sigi.apps.casas.forms import PortfolioForm -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import CasaLegislativa, TipoCasaLegislativa from sigi.apps.casas.reports import (CasasLegislativasLabels, CasasLegislativasLabelsSemPresidente) from sigi.apps.contatos.models import UnidadeFederativa, Mesorregiao, Microrregiao @@ -421,6 +421,7 @@ def export_csv(request): @login_required def portfolio(request): page = request.GET.get('page', 1) + tipo = request.GET.get('tipo', None) regiao = request.GET.get('regiao', None) uf_id = request.GET.get('uf', None) meso_id = request.GET.get('meso', None) @@ -430,16 +431,13 @@ def portfolio(request): data['errors'] = [] data['messages'] = [] data['regioes'] = UnidadeFederativa.REGIAO_CHOICES + data['tipos_casas'] = TipoCasaLegislativa.objects.all() casas = None - gerente_contas = None + gerente = None - if request.method == 'POST': - form = PortfolioForm(data=request.POST) - if form.is_valid(): - gerente_contas = form.cleaned_data['gerente_contas'] - else: - data['errors'].append(_(u"Dados inválidos")) - + if tipo: + data['tipo'] = tipo + if micro_id: microrregiao = get_object_or_404(Microrregiao, pk=micro_id) mesorregiao = microrregiao.mesorregiao @@ -451,9 +449,14 @@ def portfolio(request): data['ufs'] = UnidadeFederativa.objects.filter(regiao=uf.regiao) data['mesorregioes'] = uf.mesorregiao_set.all() data['microrregioes'] = mesorregiao.microrregiao_set.all() - data['form'] = PortfolioForm(_(u'Atribuir casas da microrregiao %s para') % (unicode(microrregiao),)) - data['querystring'] = 'micro=%s' % (microrregiao.pk,) - casas = CasaLegislativa.objects.filter(municipio__microrregiao=microrregiao) + data['form'] = PortfolioForm( + _(u'Atribuir casas da microrregiao {name} para').format( + name=unicode(microrregiao)) + ) + data['querystring'] = 'micro={0}'.format(microrregiao.pk) + casas = CasaLegislativa.objects.filter( + municipio__microrregiao=microrregiao + ) elif meso_id: mesorregiao = get_object_or_404(Mesorregiao, pk=meso_id) uf = mesorregiao.uf @@ -463,38 +466,74 @@ def portfolio(request): data['ufs'] = UnidadeFederativa.objects.filter(regiao=uf.regiao) data['mesorregioes'] = uf.mesorregiao_set.all() data['microrregioes'] = mesorregiao.microrregiao_set.all() - data['form'] = PortfolioForm(_(u'Atribuir casas da mesorregiao %s para') % (unicode(mesorregiao),)) - data['querystring'] = 'meso=%s' % (mesorregiao.pk,) - casas = CasaLegislativa.objects.filter(municipio__microrregiao__mesorregiao=mesorregiao) + data['form'] = PortfolioForm( + _(u'Atribuir casas da mesorregiao {name} para').format( + name=unicode(mesorregiao))) + data['querystring'] = 'meso={0}'.format(mesorregiao.pk) + casas = CasaLegislativa.objects.filter( + municipio__microrregiao__mesorregiao=mesorregiao + ) elif uf_id: uf = get_object_or_404(UnidadeFederativa, pk=uf_id) data['regiao'] = uf.regiao data['uf_id'] = uf.pk data['ufs'] = UnidadeFederativa.objects.filter(regiao=uf.regiao) data['mesorregioes'] = uf.mesorregiao_set.all() - data['form'] = PortfolioForm(_(u'Atribuir casas do estado %s para') % (unicode(uf),)) - data['querystring'] = 'uf=%s' % (uf.pk,) + data['form'] = PortfolioForm( + _(u'Atribuir casas do estado {name} para').format( + name=unicode(uf))) + data['querystring'] = 'uf={0}'.format(uf.pk) casas = CasaLegislativa.objects.filter(municipio__uf=uf) elif regiao: - data['regiao'] = regiao + data['regiao'] = regiao data['ufs'] = UnidadeFederativa.objects.filter(regiao=regiao) - data['form'] = PortfolioForm(_(u'Atribuir casas da região %s para') % [x[1] for x in UnidadeFederativa.REGIAO_CHOICES if x[0] == regiao][0]) - data['querystring'] = 'regiao=%s' % (regiao,) + data['form'] = PortfolioForm( + _(u'Atribuir casas da região {name} para').format( + name=[x[1] for x in UnidadeFederativa.REGIAO_CHOICES if + x[0] == regiao][0])) + data['querystring'] = 'regiao={0}'.format(regiao) casas = CasaLegislativa.objects.filter(municipio__uf__regiao=regiao) - + if casas: - if gerente_contas: - count = casas.update(gerente_contas=gerente_contas) - data['messages'].append(ungettext( - u"%(count)s casa atribuída para %(name)s", - u"%(count)s casas atribuídas para %(name)s", - count) % {'count': count, 'name': unicode(gerente_contas)}) - - casas = casas.order_by('municipio__uf', 'municipio__microrregiao__mesorregiao', + casas = casas.order_by('municipio__uf', + 'municipio__microrregiao__mesorregiao', 'municipio__microrregiao', 'municipio') - casas.prefetch_related('municipio', 'municipio__uf', 'municipio__microrregiao', - 'municipio__microrregiao__mesorregiao', 'gerente_contas') + casas.prefetch_related('municipio', 'municipio__uf', + 'municipio__microrregiao', + 'municipio__microrregiao__mesorregiao', + 'gerentes_interlegis') + + if tipo: + casas = casas.filter(tipo__sigla=tipo) + data['querystring'] += "&tipo={0}".format(tipo) + + if request.method == 'POST': + form = PortfolioForm(data=request.POST) + if form.is_valid(): + gerente = form.cleaned_data['gerente'] + acao = form.cleaned_data['acao'] + + count = casas.count() + + if acao == 'ADD': + gerente.casas_que_gerencia.add(*casas) + data['messages'].append(ungettext( + u"{count} casa adicionada para {gerente}", + u"{count} casas adicionadas para {gerente}", + count).format(count=count,gerente=gerente.nome_completo) + ) + elif acao == 'DEL': + gerente.casas_que_gerencia.remove(*casas) + data['messages'].append(ungettext( + u"{count} casa removida de {gerente}", + u"{count} casas removidas de {gerente}", + count).format(count=count,gerente=gerente.nome_completo) + ) + else: + data['errors'].append(_(u"Ação não definida")) + else: + data['errors'].append(_(u"Dados inválidos")) paginator = Paginator(casas, 30) try: @@ -635,7 +674,7 @@ def painel_relacionamento(request): snippet = request.GET.get('snippet', '') seletor = request.GET.get('s', None) servidor = request.GET.get('servidor', None) - format = request.GET.get('f', 'html') + fmt = request.GET.get('f', 'html') if servidor is None: gerente = request.user.servidor @@ -648,7 +687,7 @@ def painel_relacionamento(request): casas = gerente.casas_que_gerencia.all() if gerente is None or not casas.exists(): - casas = CasaLegislativa.objects.exclude(gerente_contas=None) + casas = CasaLegislativa.objects.exclude(gerentes_interlegis=None) gerente = None tipos_servico = TipoServico.objects.all() @@ -677,7 +716,7 @@ def painel_relacionamento(request): context['page_obj'] = pagina if snippet == 'lista': - if format == 'csv': + if fmt == 'csv': response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename=casas.csv' writer = csv.writer(response) @@ -687,7 +726,7 @@ def painel_relacionamento(request): _(u"Estado").encode('utf8'), _(u"Mesorregião").encode('utf8'), _(u"Microrregião").encode('utf8'), - _(u"Gerente de relacionamento").encode('utf8'), + _(u"Gerentes Interlegis").encode('utf8'), _(u"Serviços").encode('utf8'), ]) for c in casas: @@ -697,7 +736,7 @@ def painel_relacionamento(request): c.municipio.uf.sigla.encode('utf8'), c.municipio.microrregiao.mesorregiao.nome.encode('utf8'), c.municipio.microrregiao.nome.encode('utf8'), - c.gerente_contas.nome_completo.encode('utf8'), + c.lista_gerentes(fmt='lista').encode('utf8'), (u", ".join([s.tipo_servico.nome for s in c.servico_set.filter(data_desativacao__isnull=True)])).encode('utf8'), ]) return response diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index a77ed1e..8b42c64 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -44,7 +44,7 @@ class ConvenioAdmin(BaseModelAdmin): {'fields': ('casa_legislativa', 'num_processo_sf', 'num_convenio', 'projeto', 'observacao')} ), (_(u'Datas'), - {'fields': ('data_adesao', 'data_retorno_assinatura', + {'fields': ('data_adesao', 'data_retorno_assinatura', 'duracao', 'data_termo_aceite', 'data_pub_diario', 'data_devolucao_via', 'data_postagem_correio')} ), diff --git a/sigi/apps/convenios/migrations/0002_convenio_duracao.py b/sigi/apps/convenios/migrations/0002_convenio_duracao.py new file mode 100644 index 0000000..7422d00 --- /dev/null +++ b/sigi/apps/convenios/migrations/0002_convenio_duracao.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('convenios', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='convenio', + name='duracao', + field=models.PositiveIntegerField(help_text='Deixar em branco caso a dura\xe7\xe3o seja indefinida', null=True, verbose_name='Dura\xe7\xe3o (meses)', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 07ddcd3..59fbb07 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -1,8 +1,8 @@ -# style="list-style-type: noneo -*- coding: utf-8 -*- -from datetime import datetime +#-*- coding: utf-8 -*- +import re +from datetime import datetime, date from django.db import models from django.utils.translation import ugettext as _ - from sigi.apps.utils import SearchField @@ -58,6 +58,12 @@ class Convenio(models.Model): blank=True, help_text=_(u'Convênio firmado.') ) + duracao = models.PositiveIntegerField( + _(u"Duração (meses)"), + null=True, + blank=True, + help_text=_(u"Deixar em branco caso a duração seja indefinida") + ) data_pub_diario = models.DateField( _(u'data da publicação no Diário Oficial'), null=True, @@ -99,7 +105,59 @@ class Convenio(models.Model): ) conveniada = models.BooleanField(default=False) equipada = models.BooleanField(default=False) - + + def get_termino_convenio(self): + if (self.data_retorno_assinatura is None or + self.duracao is None): + return None + + ano = self.data_retorno_assinatura.year + int(self.duracao / 12) + mes = int(self.data_retorno_assinatura.month + int(self.duracao % 12)) + if mes > 12: + ano = ano + 1 + mes = mes - 12 + dia = self.data_retorno_assinatura.day + + while True: + try: + data_fim = date(year=ano, month=mes,day=dia) + break + except: + dia = dia - 1 + + return data_fim + + def get_status(self): + if self.data_retorno_assinatura is not None: + if self.duracao is not None: + if date.today() >= self.get_termino_convenio(): + return _(u"Vencido") + return _(u"Vigente") + + if (self.data_retorno_assinatura is None and + self.data_devolucao_sem_assinatura is None and + self.data_retorno_sem_assinatura is None): + return _(u"Pendente") + if (self.data_devolucao_sem_assinatura is not None or + self.data_retorno_sem_assinatura is not None): + return _(u"Desistência") + + return _(u"Indefinido") + + def get_sigad_url(self): + m = re.match( + r'(?P00100|00200)\.(?P\d{6})/(?P\d{4})-\d{2}', + self.num_processo_sf + ) + if m: + return (r'{processo}').format(processo=self.num_processo_sf,**m.groupdict()) + return self.num_processo_sf + def save(self, *args, **kwargs): self.conveniada = self.data_retorno_assinatura is not None self.equipada = self.data_termo_aceite is not None @@ -112,10 +170,11 @@ class Convenio(models.Model): def __unicode__(self): if self.data_retorno_assinatura is not None: - return _(u"Convênio nº %(number)s - projeto %(project)s, em %(date)s") % dict( + return _(u"Convênio {project} nº {number} assinado em {date}. Status: {status}".format( number=self.num_convenio, project=self.projeto.sigla, - date=self.data_retorno_assinatura) + date=self.data_retorno_assinatura, + status=self.get_status())) else: return _(u"Adesão ao projeto %(project)s, em %(date)s") % dict( project=self.projeto.sigla, diff --git a/sigi/apps/home/templates/home/sem_convenio.html b/sigi/apps/home/templates/home/sem_convenio.html index 451a586..4e977ef 100644 --- a/sigi/apps/home/templates/home/sem_convenio.html +++ b/sigi/apps/home/templates/home/sem_convenio.html @@ -77,7 +77,7 @@ {{ casa.nome }} {{ casa.municipio.uf.sigla }} - {{ casa.gerente_contas.nome_completo }} + {{ casa.lista_gerentes }} {% for s in casa.servico_set.all %} {% if s.data_desativacao == None %} diff --git a/sigi/apps/home/views.py b/sigi/apps/home/views.py index 1e92734..442f13f 100644 --- a/sigi/apps/home/views.py +++ b/sigi/apps/home/views.py @@ -126,9 +126,13 @@ def chart_carteira(request): 'data': [{'value': r['total_casas'], 'color': colors.next(), 'highlight': highlights.next(), - 'label': r['gerente_contas__nome_completo'] + 'label': r['gerentes_interlegis__nome_completo'] } - for r in CasaLegislativa.objects.all().values('gerente_contas__nome_completo').annotate(total_casas=Count('pk')).order_by('gerente_contas__nome_completo') + for r in CasaLegislativa.objects.exclude( + gerentes_interlegis=None).values( + 'gerentes_interlegis__nome_completo').annotate( + total_casas=Count('pk')).order_by( + 'gerentes_interlegis__nome_completo') ] } @@ -140,7 +144,7 @@ def chart_performance(request): servidor = request.GET.get('servidor', None) if servidor is None: - casas = CasaLegislativa.objects.exclude(gerente_contas=None) + casas = CasaLegislativa.objects.exclude(gerentes_interlegis=None) else: gerente = get_object_or_404(Servidor, pk=servidor) casas = gerente.casas_que_gerencia @@ -149,8 +153,12 @@ def chart_performance(request): 'type': 'pie', 'options': {'responsive': True}, 'data': [ - {'label': _(u"Utilizam serviços"), 'value': casas.exclude(servico=None).count(), 'color': '#91e8e1'}, - {'label': _(u"Não utilizam serviços"), 'value': casas.filter(servico=None).count(), 'color': '#f7a35c'}, + {'label': _(u"Utilizam serviços"), + 'value': casas.exclude(servico=None).count(), + 'color': '#91e8e1'}, + {'label': _(u"Não utilizam serviços"), + 'value': casas.filter(servico=None).count(), + 'color': '#f7a35c'}, ] } @@ -160,43 +168,52 @@ def chart_performance(request): @login_required def report_sem_convenio(request): modo = request.GET.get('modo', None) - format = request.GET.get('f', 'pdf') + fmt = request.GET.get('f', 'pdf') sc = sem_convenio() if modo == 'H': casas = sc['hospedagem'] - titulo = _(u"Casas sem convenio que utilizam algum serviço de hospedagem") + titulo = _(u"Casas sem convenio que utilizam algum serviço de " + u"hospedagem") elif modo == 'R': casas = sc['registro'] - titulo = _(u"Casas sem convenio que utilizam somente serviço de registro") + titulo = _(u"Casas sem convenio que utilizam somente serviço de " + u"registro") else: casas = sc['total'] - titulo = _(u"Casas sem convenio que utilizam algum serviço de registro e/ou hospedagem") + titulo = _(u"Casas sem convenio que utilizam algum serviço de registro " + u"e/ou hospedagem") - if format == 'csv': + if fmt == 'csv': response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename=casas.csv' writer = csv.writer(response) writer.writerow([titulo.encode('utf8')]) writer.writerow([u'']) - writer.writerow([u'casa', u'uf', u'gerente', u'serviços'.encode('utf8')]) + writer.writerow([u'casa', u'uf', u'gerentes', + u'serviços'.encode('utf8')]) for casa in casas: writer.writerow([ casa.nome.encode('utf8'), casa.municipio.uf.sigla.encode('utf8'), - casa.gerente_contas.nome_completo.encode('utf8'), - (u', '.join(casa.servico_set.filter(data_desativacao__isnull=True).values_list('tipo_servico__nome', flat=True))).encode('utf8'), + casa.lista_gerentes(fmt='lista').encode('utf8'), + (u', '.join(casa.servico_set.filter( + data_desativacao__isnull=True).values_list( + 'tipo_servico__nome', flat=True))).encode('utf8'), ]) return response - elif format == 'json': + elif fmt == 'json': data = { 'titulo': titulo, 'casas': [ {'nome': casa.nome, 'uf': casa.municipio.uf.sigla, - 'gerente': casa.gerente_contas.nome_completo, - 'servicos': list(casa.servico_set.filter(data_desativacao__isnull=True).values_list('tipo_servico__nome', flat=True))} + 'gerentes': list(casa.gerentes_interlegis.all().values_list( + 'nome_completo', flat=True)), + 'servicos': list(casa.servico_set.filter( + data_desativacao__isnull=True).values_list( + 'tipo_servico__nome', flat=True))} for casa in casas ] } diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index b72b3cb..f2f9ff4 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -25,6 +25,7 @@ from sigi.apps.servicos.models import TipoServico from sigi.apps.utils import to_ascii from sigi.settings import MEDIA_ROOT, STATIC_URL from sigi.shortcuts import render_to_pdf +from sigi.apps.servidores.models import Servidor JSON_FILE_NAME = os.path.join(MEDIA_ROOT, 'apps/metas/map_data.json') @@ -75,11 +76,15 @@ def mapa(request): [(x.sigla, x.sigla, x.nome, True) for x in TipoServico.objects.all()]), ("convenios", _(u'Por Casas conveniadas'), - [(x.sigla, 'convenio_' + x.sigla, _(u'ao %(projeto)s') % {'projeto': x.sigla}, x.sigla == 'PML') - for x in projetos]), # Apenas o ultimo #hardcoded #fixme + [(x.sigla, + 'convenio_' + x.sigla, + _(u'ao {projeto}').format(projeto=x.sigla), + x.sigla == 'PML') for x in projetos]), ("equipadas", _(u'Por Casas equipadas'), - [(x.sigla, 'equip_' + x.sigla, _(u'pelo %(projeto)s') % {'projeto': x.sigla}, False) - for x in projetos]), + [(x.sigla, + 'equip_' + x.sigla, + _(u'pelo {projeto}').format(projeto=x.sigla), + False) for x in projetos]), ("diagnosticos", _(u'Por Diagnósticos'), [('A', 'diagnostico_A', 'Em andamento', False), ('P', 'diagnostico_P', 'Publicados', True)]), @@ -91,10 +96,12 @@ def mapa(request): for x in UnidadeFederativa.objects.all()]), ("gerente", _(u'Por gerente de relacionamento'), [("", 'gerente_', _(u"Sem gerente"), False)] + - [(x.gerente_contas.id, 'gerente_%s' % (x.gerente_contas.id,), - "%s %s" % (x.gerente_contas.nome_completo.split()[0], x.gerente_contas.nome_completo.split()[-1]), False) - for x in CasaLegislativa.objects.exclude(gerente_contas=None).select_related( - 'gerente_contas').distinct('gerente_contas__nome_completo').order_by('gerente_contas__nome_completo')]), + [(g.id, 'gerente_{0}'.format(g.id), + _(u"{firstname} {lastname}").format( + firstname=g.nome_completo.split()[0], + lastname=g.nome_completo.split()[-1]) + , False) for g in Servidor.objects.exclude( + casas_que_gerencia=None).order_by('nome_completo')]), ) return render(request, 'metas/mapa.html', {'filters': filters}) @@ -271,23 +278,26 @@ def get_params(request): } -def filtrar_casas(seit, convenios, equipadas, regioes, estados, diagnosticos, gerentes): +def filtrar_casas(seit, convenios, equipadas, regioes, estados, diagnosticos, + gerentes): ''' Filtrar Casas que atendem aos parâmetros de pesquisa ''' qServico = Q(servico__tipo_servico__sigla__in=seit) qConvenio = Q(convenio__projeto__sigla__in=convenios) - qEquipada = Q(convenio__projeto__sigla__in=equipadas, convenio__equipada=True) + qEquipada = Q(convenio__projeto__sigla__in=equipadas, + convenio__equipada=True) qRegiao = Q(municipio__uf__regiao__in=regioes) qEstado = Q(municipio__uf__sigla__in=estados) if gerentes: - qGerente = Q(gerente_contas_id__in=gerentes) + qGerente = Q(gerentes_interlegis__id__in=gerentes) else: qGerente = Q() if diagnosticos: - qDiagnostico = Q(diagnostico__publicado__in=[p == 'P' for p in diagnosticos]) + qDiagnostico = Q(diagnostico__publicado__in=[p == 'P' + for p in diagnosticos]) else: qDiagnostico = Q() @@ -296,7 +306,8 @@ def filtrar_casas(seit, convenios, equipadas, regioes, estados, diagnosticos, ge if seit or convenios or equipadas or diagnosticos: casas = casas.filter(qServico | qConvenio | qEquipada | qDiagnostico) else: - casas = casas.filter(Q(servico=None) & Q(convenio=None) & Q(diagnostico=None)) + casas = casas.filter(Q(servico=None) & Q(convenio=None) & + Q(diagnostico=None)) return casas @@ -351,7 +362,7 @@ def parliament_summary(parliament): 'lng': str(parliament.municipio.longitude), 'estado': parliament.municipio.uf.sigla, 'regiao': parliament.municipio.uf.regiao, - 'gerente': (str(parliament.gerente_contas.id) if parliament.gerente_contas else ''), + 'gerentes': [str(g.id) for g in parliament.gerentes_interlegis.all()], 'diagnosticos': [], 'seit': [], 'convenios': [], @@ -359,45 +370,61 @@ def parliament_summary(parliament): 'info': [] } - if parliament.gerente_contas: - summary['info'].append(_(u"Gerente de relacionamento: %s") % parliament.gerente_contas.nome_completo) + if parliament.gerentes_interlegis.exists(): + summary['info'].append(_(u"Gerentes Interlegis: {lista}").format( + lista=parliament.lista_gerentes(fmt='lista'))) for sv in parliament.servico_set.filter(data_desativacao=None): summary['info'].append( - _(u"%(name)s ativado em %(date)s") % dict( + _(u"{name} ativado em {date}").format( name=sv.tipo_servico.nome, - date=sv.data_ativacao.strftime('%d/%m/%Y') if sv.data_ativacao else _(u'')) + - " link" % (sv.url, STATIC_URL)) + date=sv.data_ativacao.strftime('%d/%m/%Y') if sv.data_ativacao + else _(u'')) + + (u" ").format(sv.url, STATIC_URL)) summary['seit'].append(sv.tipo_servico.sigla) for cv in parliament.convenio_set.all(): - if (cv.data_retorno_assinatura is None) and (cv.equipada and cv.data_termo_aceite is not None): - summary['info'].append(_(u"Equipada em %(date)s pelo %(project)s") % dict( - date=cv.data_termo_aceite.strftime('%d/%m/%Y'), - project=cv.projeto.sigla)) + if ((cv.data_retorno_assinatura is None) and + (cv.equipada and cv.data_termo_aceite is not None)): + summary['info'].append( + _(u"Equipada em {date} pelo {project}").format( + date=cv.data_termo_aceite.strftime('%d/%m/%Y'), + project=cv.projeto.sigla)) summary['equipadas'].append(cv.projeto.sigla) elif cv.data_retorno_assinatura is None: - summary['info'].append(_(u"Adesão ao projeto %(project)s, em %(date)s") % dict( - project=cv.projeto.sigla, - date=cv.data_adesao)) + summary['info'].append( + _(u"Adesão ao projeto {project}, em {date}").format( + project=cv.projeto.sigla, date=cv.data_adesao)) summary['convenios'].append(cv.projeto.sigla) - if (cv.data_retorno_assinatura is not None) and not (cv.equipada and cv.data_termo_aceite is not None): - summary['info'].append(_(u"Conveniada ao %(project)s em %(date)s") % dict( - project=cv.projeto.sigla, - date=cv.data_retorno_assinatura.strftime('%d/%m/%Y'))) + if ((cv.data_retorno_assinatura is not None) and not + (cv.equipada and cv.data_termo_aceite is not None)): + summary['info'].append( + _(u"Conveniada ao %(project)s em %(date)s").format( + project=cv.projeto.sigla, + date=cv.data_retorno_assinatura.strftime('%d/%m/%Y'))) summary['convenios'].append(cv.projeto.sigla) - if (cv.data_retorno_assinatura is not None) and (cv.equipada and cv.data_termo_aceite is not None): - summary['info'].append(_(u"Conveniada ao %(project)s em %(date)s e equipada em %(equipped_date)s") % dict( - project=cv.projeto.sigla, - date=cv.data_retorno_assinatura.strftime('%d/%m/%Y'), - equipped_date=cv.data_termo_aceite.strftime('%d/%m/%Y'))) + if ((cv.data_retorno_assinatura is not None) and + (cv.equipada and cv.data_termo_aceite is not None)): + summary['info'].append( + _(u"Conveniada ao {project} em {date} e equipada em " + u"{equipped_date}").format( + project=cv.projeto.sigla, + date=cv.data_retorno_assinatura.strftime('%d/%m/%Y'), + equipped_date=cv.data_termo_aceite.strftime('%d/%m/%Y'))) summary['equipadas'].append(cv.projeto.sigla) summary['convenios'].append(cv.projeto.sigla) for dg in parliament.diagnostico_set.all(): summary['diagnosticos'].append('P' if dg.publicado else 'A') - summary['info'].append(_(u'Diagnosticada no período de %(initial_date)s a %(final_date)s') % dict( - initial_date=dg.data_visita_inicio.strftime('%d/%m/%Y') if dg.data_visita_inicio is not None else _(u""), - final_date=dg.data_visita_fim.strftime('%d/%m/%Y') if dg.data_visita_fim else _(u""))) + summary['info'].append( + _(u"Diagnosticada no período de {initial_date} " + u"a {final_date}").format( + initial_date=dg.data_visita_inicio.strftime('%d/%m/%Y') + if dg.data_visita_inicio is not None + else _(u""), + final_date=dg.data_visita_fim.strftime('%d/%m/%Y') + if dg.data_visita_fim + else _(u""))) return summary diff --git a/sigi/apps/ocorrencias/admin.py b/sigi/apps/ocorrencias/admin.py index 4cf1dd6..d0159f9 100644 --- a/sigi/apps/ocorrencias/admin.py +++ b/sigi/apps/ocorrencias/admin.py @@ -63,12 +63,19 @@ class OcorrenciaChangeList(ChangeList): class OcorrenciaAdmin(BaseModelAdmin): - list_display = ('data_criacao', 'casa_legislativa', 'get_municipio', 'get_uf', 'assunto', 'prioridade', 'status', 'data_modificacao', 'setor_responsavel',) - list_filter = (OcorrenciaListFilter, 'status', 'prioridade', 'categoria__nome', 'setor_responsavel__nome', 'casa_legislativa__gerente_contas',) - search_fields = ('casa_legislativa__search_text', 'assunto', 'servidor_registro__nome_completo', 'descricao', 'resolucao', 'ticket',) + list_display = ('data_criacao', 'casa_legislativa', 'get_municipio', + 'get_uf', 'assunto', 'prioridade', 'status', + 'data_modificacao', 'setor_responsavel',) + list_filter = (OcorrenciaListFilter, 'status', 'prioridade', + 'categoria__nome', 'setor_responsavel__nome', + 'casa_legislativa__gerentes_interlegis',) + search_fields = ('casa_legislativa__search_text', 'assunto', + 'servidor_registro__nome_completo', 'descricao', + 'resolucao', 'ticket',) date_hierarchy = 'data_criacao' - fields = ('casa_legislativa', 'categoria', 'tipo_contato', 'assunto', 'status', 'prioridade', 'ticket', 'descricao', 'servidor_registro', - 'setor_responsavel', 'resolucao', ) + fields = ('casa_legislativa', 'categoria', 'tipo_contato', 'assunto', + 'status', 'prioridade', 'ticket', 'descricao', + 'servidor_registro', 'setor_responsavel', 'resolucao', ) readonly_fields = ('servidor_registro', 'setor_responsavel', ) inlines = (ComentarioViewInline, ComentarioInline, AnexosInline, ) raw_id_fields = ('casa_legislativa', ) diff --git a/sigi/apps/ocorrencias/filters.py b/sigi/apps/ocorrencias/filters.py index ae8a859..de4d775 100644 --- a/sigi/apps/ocorrencias/filters.py +++ b/sigi/apps/ocorrencias/filters.py @@ -24,4 +24,6 @@ class OcorrenciaListFilter(admin.SimpleListFilter): elif self.value() == 'M': return queryset.filter(servidor_registro=servidor) elif self.value() == 'G': - return queryset.filter(casa_legislativa__gerente_contas=servidor) + return queryset.filter( + casa_legislativa__gerentes_interlegis=servidor + ) diff --git a/sigi/apps/ocorrencias/templates/ocorrencias/ocorrencia_snippet.html b/sigi/apps/ocorrencias/templates/ocorrencias/ocorrencia_snippet.html index 1b8036d..63d03d1 100644 --- a/sigi/apps/ocorrencias/templates/ocorrencias/ocorrencia_snippet.html +++ b/sigi/apps/ocorrencias/templates/ocorrencias/ocorrencia_snippet.html @@ -24,9 +24,13 @@ {% if ocorrencia.ticket %}

    {% trans "Ticket no suporte #" %}{{ ocorrencia.ticket|safe }}

    {% endif %} -

    {% trans "Gerente de contas:" %} - - {{ ocorrencia.casa_legislativa.gerente_contas }}

    +

    {% trans "Gerentes Interlegis:" %} + {% for g in ocorrencia.casa_legislativa.gerentes_interlegis.all %} + + {{ g.nome_completo }} + {% if not forloop.last %}, {% endif %} + {% endfor %} +

    {% trans 'Prioridade' %}:
    {% for id, name in PRIORITY_CHOICES %} diff --git a/sigi/apps/ocorrencias/views.py b/sigi/apps/ocorrencias/views.py index bc9f168..640fc4c 100644 --- a/sigi/apps/ocorrencias/views.py +++ b/sigi/apps/ocorrencias/views.py @@ -17,62 +17,85 @@ from django.utils.html import escape @login_required def painel_ocorrencias(request): - type = request.GET.get('type', None) + tipo = request.GET.get('type', None) id = request.GET.get('id', None) painel = request.GET.get('painel', None) data = {} - if type is None or type == 'error': - type = 'servidor' + if tipo is None or tipo == 'error': + tipo = 'servidor' u = get_object_or_404(Servidor, user=request.user) id = u.pk if id is None: raise Http404("id não definido") - if type == 'casa': + if tipo == 'casa': casa = get_object_or_404(CasaLegislativa, pk=id) - ocorrencias = Ocorrencia.objects.filter(casa_legislativa=casa) - panel_title = "%s, %s" % (casa.nome, casa.municipio.uf.sigla) - elif type == 'servidor': + ocorrencias = casa.ocorrencia_set.all() + panel_title = u"{casa}, {uf}".format( + casa=casa.nome, + uf=casa.municipio.uf.sigla + ) + elif tipo == 'servidor': servidor = get_object_or_404(Servidor, pk=id) panel_title = servidor.nome_completo - paineis = {'gerente': 'Minhas casas', 'servico': 'Meu setor', 'timeline': 'Comentados por mim'} + paineis = {'gerente': u"Minhas casas", 'servico': u"Meu setor", + 'timeline': u"Comentados por mim"} if painel is None: - if CasaLegislativa.objects.filter(gerente_contas=servidor).count() > 0: + if CasaLegislativa.objects.filter( + gerentes_interlegis=servidor).count() > 0: painel = 'gerente' - elif Ocorrencia.objects.filter(setor_responsavel=servidor.servico).count() > 0: + elif Ocorrencia.objects.filter( + setor_responsavel=servidor.servico).count() > 0: painel = 'servico' else: painel = 'timeline' - data.update({'paineis': paineis, 'painel': painel, 'servidor': servidor}) + data.update({'paineis': paineis, 'painel': painel, + 'servidor': servidor}) if painel == 'gerente': - ocorrencias = Ocorrencia.objects.filter(casa_legislativa__gerente_contas=servidor) + ocorrencias = Ocorrencia.objects.filter( + casa_legislativa__gerentes_interlegis=servidor) elif painel == 'servico': - ocorrencias = Ocorrencia.objects.filter(setor_responsavel_id=servidor.servico_id) + ocorrencias = Ocorrencia.objects.filter( + setor_responsavel_id=servidor.servico_id) else: - ocorrencias = (Ocorrencia.objects.filter(servidor_registro=servidor) | - Ocorrencia.objects.filter(comentarios__usuario=servidor)) - elif type == 'servico': + ocorrencias = ( + Ocorrencia.objects.filter(servidor_registro=servidor) | + Ocorrencia.objects.filter(comentarios__usuario=servidor) + ) + elif tipo == 'servico': servico = get_object_or_404(Servico, pk=id) - ocorrencias = Ocorrencia.objects.filter(setor_responsavel_id=id) - panel_title = "%s - %s" % (servico.sigla, servico.nome) + ocorrencias = servico.ocorrencia_set.all() + panel_title = _(u"{sigla} - {nome}").format( + sigla=servico.sigla, nome=servico.nome) - ocorrencias = ocorrencias.filter(status__in=[1,2]) + ocorrencias = ocorrencias.filter(status__in=[1, 2]) ocorrencias = ocorrencias.order_by('prioridade', '-data_modificacao') - ocorrencias = ocorrencias.select_related('casa_legislativa', 'categoria', 'tipo_contato', 'servidor_registro', 'setor_responsavel', - 'casa_legislativa__gerente_contas') - ocorrencias = ocorrencias.prefetch_related('comentarios', 'comentarios__usuario', 'comentarios__encaminhar_setor', - 'casa_legislativa__municipio', 'casa_legislativa__municipio__uf', 'anexo_set') + ocorrencias = ocorrencias.select_related( + 'casa_legislativa', 'categoria', 'tipo_contato', 'servidor_registro', + 'setor_responsavel', 'casa_legislativa__gerentes_interlegis' + ) + ocorrencias = ocorrencias.prefetch_related( + 'comentarios', 'comentarios__usuario', 'comentarios__encaminhar_setor', + 'casa_legislativa__municipio', 'casa_legislativa__municipio__uf', + 'anexo_set' + ) ocorrencias = ocorrencias.annotate(total_anexos=Count('anexo')) - data.update({'ocorrencias': ocorrencias, 'panel_title': panel_title, 'comentario_form': ComentarioForm(), - 'ocorrencia_form': OcorrenciaForm(), 'PRIORITY_CHOICES': Ocorrencia.PRIORITY_CHOICES}) + data.update( + {'ocorrencias': ocorrencias, + 'panel_title': panel_title, + 'comentario_form': ComentarioForm(), + 'ocorrencia_form': OcorrenciaForm(), + 'PRIORITY_CHOICES': Ocorrencia.PRIORITY_CHOICES + } + ) return render(request, 'ocorrencias/painel.html', data) From 53333b46d65dc25886145f67e2628f66c0cd62e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 30 Oct 2020 12:55:44 -0300 Subject: [PATCH 13/69] Ajuste nos nomes dos menus --- sigi/apps/home/templatetags/menu_conf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 161947a..c489d55 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -17,7 +17,7 @@ main_menu: url: casas/casalegislativa/?tipo__id__exact=1 - title: Assembléias Legislativas url: casas/casalegislativa/?tipo__id__exact=2 - - title: Portfólio de relacionamento + - title: Organizar relacionamentos url: casas/portfolio/ - title: Carteira de relacionamentos url: casas/carteira From aa296ac45976180519e2481cd8862227e064bccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 4 Nov 2020 13:02:03 -0300 Subject: [PATCH 14/69] =?UTF-8?q?Management=20command=20que=20exporta=20di?= =?UTF-8?q?agn=C3=B3stico=20para=20LimeSurvey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/diagnosticos/management/__init__.py | 0 .../management/commands/__init__.py | 0 .../management/commands/ls_export.py | 275 ++++++++++++++++++ .../migrations/0003_auto_20201101_2240.py | 20 ++ 4 files changed, 295 insertions(+) create mode 100644 sigi/apps/diagnosticos/management/__init__.py create mode 100644 sigi/apps/diagnosticos/management/commands/__init__.py create mode 100644 sigi/apps/diagnosticos/management/commands/ls_export.py create mode 100644 sigi/apps/diagnosticos/migrations/0003_auto_20201101_2240.py diff --git a/sigi/apps/diagnosticos/management/__init__.py b/sigi/apps/diagnosticos/management/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sigi/apps/diagnosticos/management/commands/__init__.py b/sigi/apps/diagnosticos/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sigi/apps/diagnosticos/management/commands/ls_export.py b/sigi/apps/diagnosticos/management/commands/ls_export.py new file mode 100644 index 0000000..5fe31ea --- /dev/null +++ b/sigi/apps/diagnosticos/management/commands/ls_export.py @@ -0,0 +1,275 @@ +# -*- coding: utf-8 -*- + +import csv +from collections import OrderedDict +from django.core.management.base import BaseCommand, CommandError +from sigi.apps.casas.models import Funcionario +from sigi.apps.contatos.models import UnidadeFederativa +from sigi.apps.diagnosticos.models import Categoria, Diagnostico, Resposta + +DATATYPES = { + 'text': 'T', + 'float': 'N', + 'date': 'D', + 'one': 'L', + 'many': 'M' +} + +class Command(BaseCommand): + help = u"""Exporta dados do diagnóstico para o formato Tab-Separated-Values + do LimeSurvey, conforme documentado em + https://manual.limesurvey.org/Tab_Separated_Value_survey_structure""" + + def handle(self, *args, **options): + def normalize(l): + return [s.encode('utf-8') for s in l] + + nonum = lambda s: s[s.index(' ')+1:] + avalue = lambda e: ('Y' if e.title == u'Sim' else 'N' + if e.title == u'Não' else e.id) + + setores = [(i+1, s[0], s[1]) for i, s in enumerate( + Funcionario.SETOR_CHOICES)] + + if len(args) < 2: + raise CommandError(u"Use: ls_export survey_id struct.txt data.csv") + + survey_id = args[0] + + lsf = csv.writer(open(args[1], 'wb+'), delimiter="\t", + quoting=csv.QUOTE_MINIMAL) + + struct = ['id', 'token', 'submitdate', 'lastpage', 'startlanguage', + 'seed'] + + self.stdout.write("Exporting survey structure: ") + # Structure headers # + self.stdout.write("\tStructure headers...", ending=" ") + lsf.writerow(['id', 'related_id', 'class', 'type/scale', 'name', + 'relevance', 'text', 'help', 'language', 'validation', + 'mandatory', 'other', 'default', 'same_default']) + lsf.writerows([ + ['', '', 'S', '', 'sid', '', survey_id], + ['', '', 'S', '', 'format', '', 'G'], + ['', '', 'S', '', 'language', '', 'pt-BR'], + ['', '', 'SL', '', 'surveyls_survey_id', '', survey_id, '', + 'pt-BR'], + ['', '', 'SL', '', 'surveyls_language', '', 'pt-BR', '', 'pt-BR'], + ['', '', 'SL', '', 'surveyls_title', '', + u'Diagnóstico PML'.encode('utf-8'), '', 'pt-BR']]) + self.stdout.write("Done!") + + # Identificação da Casa Legislativa e sua equipe # + self.stdout.write("\tIdentificação da Casa...", ending=" ") + lsf.writerow(normalize(['1000', '', 'G', '', u'Identificação da Casa', + '', '', '', 'pt-BR'])) + lsf.writerow(normalize(['1001', '', 'Q', 'L', 'c001q001', '1', + u'Região', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c001q001') + lsf.writerows([normalize(['1001', '', 'A', '0', sigla, '', nome, '', + 'pt-BR']) for sigla, nome in UnidadeFederativa.REGIAO_CHOICES]) + lsf.writerow(normalize(['1002', '', 'Q', '!', 'c001q002', '1', + u'Estado (UF)', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c001q002') + lsf.writerows([normalize(['1002', '', 'A', '0', u.sigla, '', u.nome, '', + 'pt-BR']) for u in UnidadeFederativa.objects.all()]) + lsf.writerow(normalize(['1003', '', 'Q', 'S', 'c001q003', '1', + u'Município', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c001q003') + lsf.writerow(normalize(['1004', '', 'Q', 'D', 'c001q004', '1', + u'Data de criação do município', '', 'pt-BR', '', 'Y', 'N', '', + '0'])) + struct.append('c001q004') + lsf.writerow(normalize(['1005', '', 'Q', 'S', 'c001q005', '1', + u'Nome da Casa', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c001q005') + lsf.writerow(normalize(['1006', '', 'Q', 'D', 'c001q006', '1', + u'Data de instalação do legislativo', '', 'pt-BR', '', 'Y', 'N', '', + '0'])) + struct.append('c001q006') + lsf.writerow(normalize(['1007', '', 'Q', 'T', 'c001q007', '1', + u'Endereço', '', 'pt-BR', '', 'N', 'N', '', '0'])) + struct.append('c001q007') + lsf.writerow(normalize(['1008', '', 'Q', 'S', 'c001q008', '1', + u'CNPJ', '', 'pt-BR', '', 'N', 'N', '', '0'])) + struct.append('c001q008') + lsf.writerow(normalize(['1009', '', 'Q', 'S', 'c001q009', '1', + u'E-mail principal', '', 'pt-BR', '', 'N', 'N', '', '0'])) + struct.append('c001q009') + lsf.writerow(normalize(['1010', '', 'Q', 'S', 'c001q010', '1', + u'Endereço Web', '', 'pt-BR', '', 'N', 'N', '', '0'])) + struct.append('c001q010') + lsf.writerow(normalize(['1011', '', 'Q', ';', 'c001q011', '1', + u'Pessoas de contato', '', 'pt-BR', '', 'N', 'N', '', '0'])) + lsf.writerow(normalize(['101198', '', 'SQ', '1', 'SQ00101', '', u'Nome', + '', 'pt-BR', '', '', 'N', '', '0'])) + lsf.writerow(normalize(['101199', '', 'SQ', '1', 'SQ00102', '', + u'E-mail', '', 'pt-BR', '', '', 'N', '', '0'])) + for i, k, v in setores: + lsf.writerow(normalize(['10110{0}'.format(i), '', 'SQ', '', + 'SQ1010{0}'.format(i), '1', v, '', 'pt-BR', '', '', 'N', + '', '0'])) + struct.extend([ + 'c001q011_SQ1010{0}_SQ00101'.format(i), + 'c001q011_SQ1010{0}_SQ00102'.format(i), + ]) + + self.stdout.write("Done!") + # Equipe de diagnóstico # + self.stdout.write("\tEquipe de diagnóstico...", ending=" ") + lsf.writerow(normalize(['2000', '', 'G', '', u'Equipe de diagnóstico', + '', '', '', 'pt-BR'])) + lsf.writerow(normalize(['2001', '', 'Q', 'D', 'c002q001', '1', + u'Data de início da visita', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c002q001') + lsf.writerow(normalize(['2002', '', 'Q', 'D', 'c002q002', '1', + u'Data de término da visita', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c002q002') + lsf.writerow(normalize(['2003', '', 'Q', 'S', 'c002q003', '1', + u'Líder da equipe', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c002q003') + lsf.writerow(normalize(['2004', '', 'Q', 'T', 'c002q004', '1', + u'Membros da equipe', '', 'pt-BR', '', 'Y', 'N', '', '0'])) + struct.append('c002q004') + self.stdout.write("Done!") + + for c in Categoria.objects.all(): + self.stdout.write("\t{0}...".format(nonum(c.nome).encode('utf-8')), ending=" ") + lsf.writerow(normalize([str(c.id), '', 'G', '', + nonum(c.nome), '', nonum(c.nome), '', + 'pt-BR'])) + perguntas = sorted([(p.title, p) for p in c.perguntas.all()]) + for t, p in perguntas: + lstype = DATATYPES[p.datatype] + # Hack para perguntas SIM/NÃO que foram cadastradas como Choice + if lstype == 'L': + if ("".join([e.title for e in p.choices.all()]) in + [u"SimNão", u"NãoSim"]): + lstype = 'Y' + ######## + relevance = "1" + if p.abre_por.exists(): + relevance = "(" + " or ".join( + [u'({sid}X{gid}X{qid}.NAOK == "{value}")'.format( + sid=survey_id, gid=e.schema.categoria.id, + qid=e.schema.id, value=avalue(e)) for e in + p.abre_por.all()]) + ")" + + lsf.writerow(normalize([str(p.id), '', 'Q', lstype, + 'c{0:03}q{1:03}'.format(c.id, p.id), relevance, + nonum(p.title), p.help_text, 'pt-BR', '', 'NY'[p.required], + 'N', '', '0'])) + if lstype == 'L': + lsf.writerows([normalize([str(p.id), u'', u'A', u'0', + str(e.id), u'', e.title, u'', u'pt-BR']) + for e in p.choices.all()]) + if lstype == 'M': + lsf.writerows([normalize([str(p.id*1000+e.id), u'', u'SQ', + u'', str(e.id), u'1', e.title, u'', u'pt-BR']) + for e in p.choices.all()]) + struct.extend(['c{0:03}q{1:03}_{2}'.format(c.id, p.id, + e.id) for e in p.choices.all()]) + else: + struct.extend(['c{0:03}q{1:03}'.format(c.id, p.id)]) + self.stdout.write("Done!") + + if len(args) < 3: # No data export + return + + self.stdout.write("Exporting survey data: ") + + dtf = csv.writer(open(args[2], 'wb+'), delimiter='\t', + quoting=csv.QUOTE_MINIMAL) + + dtf.writerow(struct) + + for d in Diagnostico.objects.all(): + self.stdout.write(u"\t{0}".format(d.casa_legislativa.nome)) + + form = OrderedDict.fromkeys(struct, '{question_not_shown}') + + form['id'] = str(d.id) + if d.data_publicacao: + form['submitdate'] = d.data_publicacao.isoformat() + # form['lastpage'] = '8' + form['startlanguage'] = 'pt-BR' + # form['seed'] = '123456' + + # Identificação da Casa Legislativa e sua equipe # + form['c001q001'] = d.casa_legislativa.municipio.uf.regiao + form['c001q002'] = d.casa_legislativa.municipio.uf.sigla + form['c001q003'] = d.casa_legislativa.municipio.nome + if d.casa_legislativa.municipio.data_criacao: + form['c001q004'] = \ + d.casa_legislativa.municipio.data_criacao.isoformat() + form['c001q005'] = d.casa_legislativa.nome + if d.casa_legislativa.data_instalacao: + form['c001q006'] = \ + d.casa_legislativa.data_instalacao.isoformat() + form['c001q007'] = ( + u"{logradouro}{{cr}}{{newline}}" + u"{bairro}{{cr}}{{newline}}" + u"{cep} - {municipio} - {uf}".format( + logradouro=d.casa_legislativa.logradouro, + bairro=d.casa_legislativa.bairro, + cep=d.casa_legislativa.cep, + municipio=d.casa_legislativa.municipio.nome, + uf=d.casa_legislativa.municipio.uf.sigla + )) + form['c001q008'] = d.casa_legislativa.cnpj + form['c001q009'] = d.casa_legislativa.email + form['c001q010'] = d.casa_legislativa.pagina_web + + for i, k, v in setores: + q = d.casa_legislativa.funcionario_set.filter(setor=k) + if q.exists(): + f = q.first() + knome = 'c001q011_SQ1010{0}_SQ00101'.format(i) + kmail = 'c001q011_SQ1010{0}_SQ00102'.format(i) + form[knome] = f.nome + form[kmail] = f.email + + if d.data_visita_inicio: + form['c002q001'] = d.data_visita_inicio.isoformat() + if d.data_visita_fim: + form['c002q002'] = d.data_visita_fim.isoformat() + form['c002q003'] = d.responsavel.nome_completo + form['c002q004'] = "{cr}{newline}".join( + [e.membro.nome_completo for e in d.equipe_set.all()]) + + for r in Resposta.objects.filter(entity_id=d.id): + if r.schema.datatype == 'many': + key = "c{cid:03}q{qid:03}_{sqid}".format( + cid=r.schema.categoria.id, + qid=r.schema.id, + sqid=r.value.id + ) + value = 'Y' + else: + key = "c{cid:03}q{qid:03}".format(cid=r.schema.categoria.id, + qid=r.schema.id) + value = r.value + if r.schema.datatype == 'one': + if value is None: + value = '{question_not_shown}' + elif value.title == u'Sim': + value = 'Y' + elif value.title == u'Não': + value = 'N' + else: + value = r.value.id + elif r.schema.datatype == 'text': + value = value.\ + replace('\r\n', '{cr}{newline}').\ + replace('\r', '{cr}{newline}').\ + replace('\n', '{cr}{newline}').\ + replace('\t', ' ') + + if value is None: + value = '{question_not_shown}' + form[key] = u'{0}'.format(value) + dtf.writerow(normalize(form.values())) + + self.stdout.write('Done!') + + diff --git a/sigi/apps/diagnosticos/migrations/0003_auto_20201101_2240.py b/sigi/apps/diagnosticos/migrations/0003_auto_20201101_2240.py new file mode 100644 index 0000000..a5af789 --- /dev/null +++ b/sigi/apps/diagnosticos/migrations/0003_auto_20201101_2240.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('diagnosticos', '0002_auto_20170407_1024'), + ] + + operations = [ + migrations.AlterField( + model_name='escolha', + name='schema_to_open', + field=models.ForeignKey(related_name='abre_por', verbose_name='pergunta para abrir', blank=True, to='diagnosticos.Pergunta', null=True), + preserve_default=True, + ), + ] From 4d1b2df4ef29efe3a8c595a30e5b5a98dd407b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 18 Feb 2021 15:54:39 -0300 Subject: [PATCH 15/69] =?UTF-8?q?Altera=C3=A7=C3=B5es=20para=20o=20gabinet?= =?UTF-8?q?e=20do=20ILB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- moodlerouter.py | 24 - sigi/apps/casas/admin.py | 96 +- .../migrations/0008_auto_20210218_1007.py | 45 + sigi/apps/casas/models.py | 30 +- sigi/apps/diagnosticos/models.py | 2 +- sigi/apps/eventos/admin.py | 3 +- .../0004_remove_evento_curso_moodle_id.py | 18 + sigi/apps/eventos/models.py | 42 - sigi/apps/home/templatetags/menu_conf.yaml | 11 +- sigi/apps/mdl/__init__.py | 0 sigi/apps/mdl/admin.py | 3 - sigi/apps/mdl/base_models.py | 6007 ----------------- sigi/apps/mdl/migrations/0001_initial.py | 116 - sigi/apps/mdl/migrations/__init__.py | 0 sigi/apps/mdl/models.py | 360 - sigi/apps/mdl/views.py | 3 - sigi/apps/saberes/__init__.py | 0 sigi/apps/saberes/admin.py | 13 - sigi/apps/saberes/management/__init__.py | 0 .../saberes/management/commands/__init__.py | 0 .../management/commands/get_moodle_stats.py | 102 - sigi/apps/saberes/migrations/0001_initial.py | 44 - sigi/apps/saberes/migrations/__init__.py | 0 sigi/apps/saberes/models.py | 74 - .../saberes/templates/saberes/dashboard.html | 13 - .../saberes/templates/saberes/detail.html | 50 - .../saberes/templates/saberes/snippets.html | 33 - sigi/apps/saberes/urls.py | 14 - sigi/apps/saberes/views.py | 50 - sigi/apps/utils/moodle_ws_api.py | 87 - sigi/settings/base.py | 8 - sigi/settings/dev.py | 13 +- sigi/urls.py | 5 - 33 files changed, 143 insertions(+), 7123 deletions(-) delete mode 100644 moodlerouter.py create mode 100644 sigi/apps/casas/migrations/0008_auto_20210218_1007.py create mode 100644 sigi/apps/eventos/migrations/0004_remove_evento_curso_moodle_id.py delete mode 100644 sigi/apps/mdl/__init__.py delete mode 100644 sigi/apps/mdl/admin.py delete mode 100644 sigi/apps/mdl/base_models.py delete mode 100644 sigi/apps/mdl/migrations/0001_initial.py delete mode 100644 sigi/apps/mdl/migrations/__init__.py delete mode 100644 sigi/apps/mdl/models.py delete mode 100644 sigi/apps/mdl/views.py delete mode 100644 sigi/apps/saberes/__init__.py delete mode 100644 sigi/apps/saberes/admin.py delete mode 100644 sigi/apps/saberes/management/__init__.py delete mode 100644 sigi/apps/saberes/management/commands/__init__.py delete mode 100644 sigi/apps/saberes/management/commands/get_moodle_stats.py delete mode 100644 sigi/apps/saberes/migrations/0001_initial.py delete mode 100644 sigi/apps/saberes/migrations/__init__.py delete mode 100644 sigi/apps/saberes/models.py delete mode 100644 sigi/apps/saberes/templates/saberes/dashboard.html delete mode 100644 sigi/apps/saberes/templates/saberes/detail.html delete mode 100644 sigi/apps/saberes/templates/saberes/snippets.html delete mode 100644 sigi/apps/saberes/urls.py delete mode 100644 sigi/apps/saberes/views.py delete mode 100644 sigi/apps/utils/moodle_ws_api.py diff --git a/moodlerouter.py b/moodlerouter.py deleted file mode 100644 index 4ea4aa1..0000000 --- a/moodlerouter.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- - - -class MoodleRouter(object): - - def db_for_read(self, model, **hints): - if model._meta.app_label == 'mdl': - return 'moodle' - return None - - def db_for_write(self, model, **hints): - if model._meta.app_label == 'mdl': - return 'moodle' - return None - - def allow_relation(self, obj1, obj2, **hints): - if obj1._meta.app_label == 'mdl' and obj2._meta.app_label == 'mdl': - return True - return None - - def allow_migrate(self, db, model): - if model._meta.app_label == 'mdl': - return False - return None diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 08b90f1..c00b3ee 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -34,31 +34,43 @@ class TelefonesInline(generic.GenericTabularInline): class PresidenteInline(admin.StackedInline): model = Presidente - fieldsets = ((None, { - 'fields': ( - ('nome', 'sexo', 'data_nascimento'), - ('nota', 'email', 'tempo_de_servico'), - ('ult_alteracao',), - ) - }),) + fields = ('nome', 'sexo', 'data_nascimento', 'nota', 'email', + 'tempo_de_servico', 'ult_alteracao', 'endereco', 'municipio', + 'bairro', 'cep', 'redes_sociais',) + raw_id_fields = ('municipio',) + # fieldsets = ((None, { + # 'fields': ( + # ('nome', 'sexo', 'data_nascimento'), + # ('nota', 'email', 'tempo_de_servico'), + # ('ult_alteracao',), + # ) + # }),) # exclude = ['setor', 'cargo', 'funcao'] readonly_fields = ('ult_alteracao',) extra = 1 max_num = 1 - inlines = (TelefonesInline) + verbose_name_plural = _(u'Presidente') class FuncionariosInline(admin.StackedInline): model = Funcionario - fieldsets = ((None, { - 'fields': ( - ('nome', 'sexo', 'data_nascimento'), - ('nota', 'email'), - ('cargo', 'funcao', 'setor'), - ('tempo_de_servico', 'ult_alteracao'), - ('desativado', 'observacoes'), - ) - }),) + fields = ('nome', 'sexo', 'data_nascimento', 'nota', 'email', 'cargo', + 'funcao', 'setor', 'tempo_de_servico', 'ult_alteracao', + 'endereco', 'municipio', 'bairro', 'cep', 'redes_sociais', + 'desativado', 'observacoes') + raw_id_fields = ('municipio',) + # fieldsets = ((None, { + # 'fields': ( + # ('nome', 'sexo', 'data_nascimento'), + # ('nota', 'email'), + # ('cargo', 'funcao', 'setor'), + # ('tempo_de_servico', 'ult_alteracao'), + # ('endereco', 'municipio'), + # ('bairro', 'cep'), + # ('redes_sociais'), + # ('desativado', 'observacoes'), + # ) + # }),) readonly_fields = ('ult_alteracao',) extra = 1 inlines = (TelefonesInline,) @@ -73,7 +85,7 @@ class ConveniosInline(admin.TabularInline): model = Convenio fieldsets = ( (None, {'fields': ( - ('link_sigad', 'status_convenio', 'num_convenio', + ('link_sigad', 'status_convenio', 'num_convenio', 'projeto', 'observacao'), ('data_adesao', 'data_retorno_assinatura', 'data_termo_aceite', 'data_pub_diario', 'data_devolucao_via', 'data_postagem_correio'), @@ -89,25 +101,25 @@ class ConveniosInline(admin.TabularInline): 'data_retorno_sem_assinatura',] extra = 0 can_delete = False - + def has_add_permission(self, request): return False # def get_tramitacoes(self, obj): # return '
    '.join([t.__unicode__() for t in obj.tramitacao_set.all()]) -# +# # get_tramitacoes.short_description = _(u'Tramitações') # get_tramitacoes.allow_tags = True -# +# # def get_anexos(self, obj): # return '
    '.join(['%s' % (a.arquivo.url, a.__unicode__()) for a in obj.anexo_set.all()]) -# +# # get_anexos.short_description = _(u'Anexos') # get_anexos.allow_tags = True -# +# # def get_equipamentos(self, obj): # return '
    '.join([e.__unicode__() for e in obj.equipamentoprevisto_set.all()]) -# +# # get_equipamentos.short_description = _(u'Equipamentos previstos') # get_equipamentos.allow_tags = True @@ -115,7 +127,7 @@ class ConveniosInline(admin.TabularInline): if obj.pk is None: return "" status = obj.get_status() - + if status in [u"Vencido", u"Desistência"]: label = r"danger" elif status == u"Vigente": @@ -124,11 +136,11 @@ class ConveniosInline(admin.TabularInline): label = r"warning" else: label = r"info" - + return u'

    {status}

    '.format(label=label, status=status) status_convenio.short_description = _(u"Status do convênio") status_convenio.allow_tags = True - + def link_convenio(self, obj): if obj.pk is None: @@ -142,12 +154,12 @@ class ConveniosInline(admin.TabularInline): link_convenio.short_description = _(u'Editar convenio') link_convenio.allow_tags = True - + def link_sigad(self, obj): if obj.pk is None: return "" return obj.get_sigad_url() - + link_sigad.short_description = _("Processo no Senado") link_sigad.allow_tags = True @@ -218,7 +230,7 @@ class OcorrenciaInline(admin.TabularInline): max_num = 0 can_delete = False template = 'casas/ocorrencia_inline.html' - + def link_editar(self, obj): if obj.pk is None: return "" @@ -242,29 +254,29 @@ class GerentesInterlegisFilter(admin.filters.RelatedFieldListFilter): class ConvenioFilter(admin.SimpleListFilter): title = _(u"Tipo de convênio") parameter_name = 'convenio' - + def lookups(self, request, model_admin): return ( ('SC', _(u"Sem nenhum convênio")), ('CC', _(u"Com algum convênio")) ) + tuple([(p.pk, p.sigla) for p in Projeto.objects.all()]) - + def queryset(self, request, queryset): if self.value() is not None: if self.value() == 'SC': - queryset = queryset.filter(convenio=None) + queryset = queryset.filter(convenio=None) elif self.value() == 'CC': queryset = queryset.exclude(convenio=None) else: queryset = queryset.filter(convenio__projeto_id=self.value()) - + return queryset.distinct('municipio__uf__nome', 'nome') class ServicoFilter(admin.SimpleListFilter): title = _(u"Serviço") parameter_name = 'servico' - + def lookups(self, request, model_admin): return ( ('SS', _(u"Sem nenhum serviço")), @@ -272,7 +284,7 @@ class ServicoFilter(admin.SimpleListFilter): ('CH', _(u"Com algum serviço de hospedagem")), ('CR', _(u"Apenas serviço de registro")), ) + tuple([(p.pk, p.nome) for p in TipoServico.objects.all()]) - + def queryset(self, request, queryset): if self.value() is not None: if self.value() == 'SS': @@ -299,7 +311,7 @@ class ServicoFilter(admin.SimpleListFilter): class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): form = CasaLegislativaForm actions = ['adicionar_casas', ] - inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, + inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, ConveniosInline, LegislaturaInline, DiagnosticoInline, BemInline, ServicoInline, PlanoDiretorInline, OcorrenciaInline,) list_display = ('nome', 'get_uf', 'get_gerentes', 'get_convenios', @@ -321,7 +333,7 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): }), (_(u'Presença na Internet'), { 'fields': ('inclusao_digital', 'data_levantamento', 'pesquisador', - 'pagina_web', 'email', 'obs_pesquisa',) + 'pagina_web', 'email', 'obs_pesquisa',) }), (_(u'Outras informações'), { 'fields': ('observacoes', 'horario_funcionamento', 'foto', @@ -334,24 +346,24 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') filter_horizontal = ('gerentes_interlegis',) - + def get_uf(self, obj): return obj.municipio.uf.nome get_uf.short_description = _(u'Unidade da Federação') get_uf.admin_order_field = 'municipio__uf__nome' - + def get_gerentes(self, obj): return obj.lista_gerentes get_gerentes.short_description = _(u'Gerente Interlegis') get_gerentes.allow_tags = True - + def get_convenios(self, obj): return '
      ' + ''.join(['
    • %s
    • ' % c.__unicode__() for c in obj.convenio_set.all()]) + '
    ' get_convenios.short_description = _(u'Convênios') get_convenios.allow_tags = True - + def get_servicos(self, obj): return '
      ' + ''.join(['
    • %s
    • ' % s.__unicode__() for s in obj.servico_set.filter( diff --git a/sigi/apps/casas/migrations/0008_auto_20210218_1007.py b/sigi/apps/casas/migrations/0008_auto_20210218_1007.py new file mode 100644 index 0000000..a4294ff --- /dev/null +++ b/sigi/apps/casas/migrations/0008_auto_20210218_1007.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('contatos', '0002_auto_20151104_0810'), + ('casas', '0007_auto_20201016_1632'), + ] + + operations = [ + migrations.AddField( + model_name='funcionario', + name='bairro', + field=models.CharField(max_length=100, verbose_name='Bairro', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='funcionario', + name='cep', + field=models.CharField(max_length=10, verbose_name='CEP', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='funcionario', + name='endereco', + field=models.CharField(max_length=100, verbose_name='Endere\xe7o', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='funcionario', + name='municipio', + field=models.ForeignKey(verbose_name='Municipio', to='contatos.Municipio', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='funcionario', + name='redes_sociais', + field=models.TextField(help_text='Colocar um por linha', verbose_name='Redes sociais', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index d2366ee..9b16b4c 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -8,6 +8,7 @@ from django.contrib.contenttypes import generic from django.db import models from image_cropping import ImageRatioField +from sigi.apps.contatos.models import Municipio from sigi.apps.servidores.models import Servidor from sigi.apps.utils import SearchField @@ -31,14 +32,14 @@ class CasaLegislativa(models.Model): """ Modelo para representar uma Casa Legislativa """ - + INCLUSAO_DIGITAL_CHOICES = ( ('NAO PESQUISADO', _(u'Não pesquisado')), ('NAO POSSUI PORTAL', _(u'Não possui portal')), ('PORTAL MODELO', _(u'Possui Portal Modelo')), ('OUTRO PORTAL', _(u'Possui outro portal')), ) - + nome = models.CharField( _(u"Nome"), max_length=60, @@ -63,7 +64,7 @@ class CasaLegislativa(models.Model): blank=True ) # codigo_interlegis.ts_filter = True - + gerentes_interlegis = models.ManyToManyField( Servidor, verbose_name=_(u"Gerentes Interlegis"), @@ -72,7 +73,7 @@ class CasaLegislativa(models.Model): # Informações de contato logradouro = models.CharField( - _(u"Logradouro"), + _(u"Logradouro"), max_length=100, help_text=_(u'Avenida, rua, praça, jardim, parque...') ) @@ -92,7 +93,7 @@ class CasaLegislativa(models.Model): blank=True, ) inclusao_digital = models.CharField( - _(u"Inclusão digital"), + _(u"Inclusão digital"), max_length=30, choices=INCLUSAO_DIGITAL_CHOICES, default=INCLUSAO_DIGITAL_CHOICES[0][0] @@ -150,9 +151,9 @@ class CasaLegislativa(models.Model): [g.nome_completo for g in self.gerentes_interlegis.all()])+\ u"
    " else: - return u", ".join([g.nome_completo for g in + return u", ".join([g.nome_completo for g in self.gerentes_interlegis.all()]) - + @property def num_parlamentares(self): if not self.legislatura_set.exists(): @@ -359,7 +360,20 @@ class Funcionario(models.Model): blank=True ) email = models.CharField(_(u'e-mail'), max_length=75, blank=True) - endereco = generic.GenericRelation('contatos.Endereco') + # endereco = generic.GenericRelation('contatos.Endereco') + endereco = models.CharField(_(u'Endereço'), max_length=100, blank=True) + municipio = models.ForeignKey( + Municipio, + verbose_name=_(u'Municipio'), + null=True + ) + bairro = models.CharField(_(u'Bairro'), max_length=100, blank=True) + cep = models.CharField(_(u'CEP'), max_length=10, blank=True) + redes_sociais = models.TextField( + _(u'Redes sociais'), + help_text=_(u'Colocar um por linha'), + blank=True + ) cargo = models.CharField(_(u"Cargo"), max_length=100, null=True, blank=True) funcao = models.CharField( _(u'função'), diff --git a/sigi/apps/diagnosticos/models.py b/sigi/apps/diagnosticos/models.py index 1b71459..c55739d 100644 --- a/sigi/apps/diagnosticos/models.py +++ b/sigi/apps/diagnosticos/models.py @@ -198,7 +198,7 @@ class Escolha(BaseChoice): """ schema = models.ForeignKey(Pergunta, related_name='choices', verbose_name=_(u'pergunta')) - schema_to_open = models.ForeignKey(Pergunta, related_name='', + schema_to_open = models.ForeignKey(Pergunta, related_name='abre_por', verbose_name=_(u'pergunta para abrir'), blank=True, null=True) ordem = models.PositiveIntegerField(blank=True, null=True) diff --git a/sigi/apps/eventos/admin.py b/sigi/apps/eventos/admin.py index fb1c415..94c6c58 100644 --- a/sigi/apps/eventos/admin.py +++ b/sigi/apps/eventos/admin.py @@ -28,8 +28,7 @@ class EventoAdminForm(forms.ModelForm): model = Evento fields = ('tipo_evento', 'nome', 'descricao', 'solicitante', 'data_inicio', 'data_termino', 'casa_anfitria', 'municipio', 'local', 'publico_alvo', 'status', - 'data_cancelamento', 'motivo_cancelamento', 'curso_moodle_id', - ) + 'data_cancelamento', 'motivo_cancelamento', ) def clean(self): cleaned_data = super(EventoAdminForm, self).clean() diff --git a/sigi/apps/eventos/migrations/0004_remove_evento_curso_moodle_id.py b/sigi/apps/eventos/migrations/0004_remove_evento_curso_moodle_id.py new file mode 100644 index 0000000..91017e0 --- /dev/null +++ b/sigi/apps/eventos/migrations/0004_remove_evento_curso_moodle_id.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('eventos', '0003_auto_20151104_0810'), + ] + + operations = [ + migrations.RemoveField( + model_name='evento', + name='curso_moodle_id', + ), + ] diff --git a/sigi/apps/eventos/models.py b/sigi/apps/eventos/models.py index 0374d26..721c63e 100644 --- a/sigi/apps/eventos/models.py +++ b/sigi/apps/eventos/models.py @@ -1,22 +1,4 @@ # -*- coding: utf-8 -*- -# -# sigi.apps.eventos.models -# -# Copyright (C) 2015 Interlegis -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from django.db import models from django.utils.functional import lazy @@ -24,9 +6,7 @@ from django.utils.translation import ugettext as _ from sigi.apps.casas.models import CasaLegislativa from sigi.apps.contatos.models import Municipio from sigi.apps.servidores.models import Servidor -from sigi.apps.utils.moodle_ws_api import get_courses from django.core.exceptions import ValidationError -from sigi.apps.mdl.models import Course class TipoEvento(models.Model): nome = models.CharField(_(u"Nome"), max_length=100) @@ -46,26 +26,6 @@ class Evento(models.Model): ('R', _(u"Realizado")), ('C', _(u"Cancelado")) ) - -# def get_course_choices(): -# result = [(None, u'---------')] -# -# try: -# courses = get_courses(sort_order='categorysortorder', idnumber__startswith='evento') -# result = result + [(c['id'], c['fullname']) for c in courses] -# except Exception as e: -# result.append((None, _(u"Erro ao acessar o saberes: '%s'" % (e.message,)))) -# -# return result - - def get_course_choices(): - from django.apps import apps - if apps.models_ready: - courses = Course.objects.filter(idnumber__startswith='evento') - else: - courses = [] - result = [(None, u'---------')] + [(c.id, c.fullname) for c in courses] - return result tipo_evento = models.ForeignKey(TipoEvento) nome = models.CharField(_(u"Nome do evento"), max_length=100) @@ -81,8 +41,6 @@ class Evento(models.Model): status = models.CharField(_(u"Status"), max_length=1, choices=STATUS_CHOICES) data_cancelamento = models.DateField(_(u"Data de cancelamento"), blank=True, null=True) motivo_cancelamento = models.TextField(_(u"Motivo do cancelamento"), blank=True) - curso_moodle_id = models.IntegerField(_(u"Curso saberes"), blank=True, null=True, - choices=lazy(get_course_choices, list)()) class Meta: ordering = ("-data_inicio",) diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index c489d55..0388ff7 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -113,13 +113,4 @@ main_menu: url: financeiro/desembolso/ children: - title: Desembolsos - url: financeiro/desembolso/ - - title: Saberes - url: '/' - children: - - title: Dashboard - url: saberes/dashboard/ - - title: Cursos sem Tutoria - url: saberes/dashboard/cursos-sem-turoria/ - - title: Cursos com Tutoria - url: saberes/dashboard/cursos-com-turoria/ + url: financeiro/desembolso/ \ No newline at end of file diff --git a/sigi/apps/mdl/__init__.py b/sigi/apps/mdl/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sigi/apps/mdl/admin.py b/sigi/apps/mdl/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/sigi/apps/mdl/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/sigi/apps/mdl/base_models.py b/sigi/apps/mdl/base_models.py deleted file mode 100644 index 616182b..0000000 --- a/sigi/apps/mdl/base_models.py +++ /dev/null @@ -1,6007 +0,0 @@ -# This is an auto-generated Django model module. -# You'll have to do the following manually to clean this up: -# * Rearrange models' order -# * Make sure each model has one field with primary_key=True -# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table -# Feel free to rename the models, but don't rename db_table values or field names. -# -# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [app_label]' -# into your database. -from __future__ import unicode_literals - -from django.db import models - - -class AdodbLogsql(models.Model): - id = models.BigIntegerField(primary_key=True) - created = models.DateTimeField() - sql0 = models.CharField(max_length=250) - sql1 = models.TextField(blank=True) - params = models.TextField(blank=True) - tracer = models.TextField(blank=True) - timer = models.DecimalField(max_digits=16, decimal_places=6) - - class Meta: - managed = False - db_table = 'adodb_logsql' - - -class BackupRoleAssignments(models.Model): - id = models.BigIntegerField() - roleid = models.BigIntegerField() - contextid = models.BigIntegerField() - userid = models.BigIntegerField() - hidden = models.SmallIntegerField() - timestart = models.BigIntegerField() - timeend = models.BigIntegerField() - timemodified = models.BigIntegerField() - modifierid = models.BigIntegerField() - enrol = models.CharField(max_length=20) - sortorder = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'backup_role_assignments' - - -class BkpLista(models.Model): - id = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'bkp_lista' - - -class IbgeMunicipio(models.Model): - codigo_ibge = models.IntegerField() - nome = models.CharField(max_length=50) - uf_id = models.IntegerField() - - class Meta: - managed = False - db_table = 'ibge_municipio' - - -class IbgeUnidadefederativa(models.Model): - codigo_ibge = models.IntegerField() - nome = models.CharField(max_length=25) - sigla = models.CharField(max_length=2) - - class Meta: - managed = False - db_table = 'ibge_unidadefederativa' - - -class MdlAssign(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - introformat = models.SmallIntegerField() - alwaysshowdescription = models.SmallIntegerField() - nosubmissions = models.SmallIntegerField() - submissiondrafts = models.SmallIntegerField() - sendnotifications = models.SmallIntegerField() - sendlatenotifications = models.SmallIntegerField() - duedate = models.BigIntegerField() - allowsubmissionsfromdate = models.BigIntegerField() - grade = models.BigIntegerField() - timemodified = models.BigIntegerField() - requiresubmissionstatement = models.SmallIntegerField() - completionsubmit = models.SmallIntegerField() - cutoffdate = models.BigIntegerField() - teamsubmission = models.SmallIntegerField() - requireallteammemberssubmit = models.SmallIntegerField() - teamsubmissiongroupingid = models.BigIntegerField() - blindmarking = models.SmallIntegerField() - revealidentities = models.SmallIntegerField() - attemptreopenmethod = models.CharField(max_length=10) - maxattempts = models.IntegerField() - markingworkflow = models.SmallIntegerField() - markingallocation = models.SmallIntegerField() - sendstudentnotifications = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assign' - - -class MdlAssignGrades(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - grader = models.BigIntegerField() - grade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - attemptnumber = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assign_grades' - - -class MdlAssignPluginConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - plugin = models.CharField(max_length=28) - subtype = models.CharField(max_length=28) - name = models.CharField(max_length=28) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_assign_plugin_config' - - -class MdlAssignSubmission(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - status = models.CharField(max_length=10, blank=True) - groupid = models.BigIntegerField() - attemptnumber = models.BigIntegerField() - latest = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assign_submission' - - -class MdlAssignUserFlags(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - assignment = models.BigIntegerField() - locked = models.BigIntegerField() - mailed = models.SmallIntegerField() - extensionduedate = models.BigIntegerField() - workflowstate = models.CharField(max_length=20, blank=True) - allocatedmarker = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assign_user_flags' - - -class MdlAssignUserMapping(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - userid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assign_user_mapping' - - -class MdlAssignfeedbackComments(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - grade = models.BigIntegerField() - commenttext = models.TextField(blank=True) - commentformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignfeedback_comments' - - -class MdlAssignfeedbackEditpdfAnnot(models.Model): - id = models.BigIntegerField(primary_key=True) - gradeid = models.BigIntegerField() - pageno = models.BigIntegerField() - x = models.BigIntegerField(blank=True, null=True) - y = models.BigIntegerField(blank=True, null=True) - endx = models.BigIntegerField(blank=True, null=True) - endy = models.BigIntegerField(blank=True, null=True) - path = models.TextField(blank=True) - type = models.CharField(max_length=10, blank=True) - colour = models.CharField(max_length=10, blank=True) - draft = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignfeedback_editpdf_annot' - - -class MdlAssignfeedbackEditpdfCmnt(models.Model): - id = models.BigIntegerField(primary_key=True) - gradeid = models.BigIntegerField() - x = models.BigIntegerField(blank=True, null=True) - y = models.BigIntegerField(blank=True, null=True) - width = models.BigIntegerField(blank=True, null=True) - rawtext = models.TextField(blank=True) - pageno = models.BigIntegerField() - colour = models.CharField(max_length=10, blank=True) - draft = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignfeedback_editpdf_cmnt' - - -class MdlAssignfeedbackEditpdfQuick(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - rawtext = models.TextField() - width = models.BigIntegerField() - colour = models.CharField(max_length=10, blank=True) - - class Meta: - managed = False - db_table = 'mdl_assignfeedback_editpdf_quick' - - -class MdlAssignfeedbackFile(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - grade = models.BigIntegerField() - numfiles = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignfeedback_file' - - -class MdlAssignment(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - introformat = models.SmallIntegerField() - assignmenttype = models.CharField(max_length=50) - resubmit = models.SmallIntegerField() - preventlate = models.SmallIntegerField() - emailteachers = models.SmallIntegerField() - var1 = models.BigIntegerField(blank=True, null=True) - var2 = models.BigIntegerField(blank=True, null=True) - var3 = models.BigIntegerField(blank=True, null=True) - var4 = models.BigIntegerField(blank=True, null=True) - var5 = models.BigIntegerField(blank=True, null=True) - maxbytes = models.BigIntegerField() - timedue = models.BigIntegerField() - timeavailable = models.BigIntegerField() - grade = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignment' - - -class MdlAssignmentSubmissions(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - numfiles = models.BigIntegerField() - data1 = models.TextField(blank=True) - data2 = models.TextField(blank=True) - grade = models.BigIntegerField() - submissioncomment = models.TextField() - format = models.SmallIntegerField() - teacher = models.BigIntegerField() - timemarked = models.BigIntegerField() - mailed = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignment_submissions' - - -class MdlAssignmentUpgrade(models.Model): - id = models.BigIntegerField(primary_key=True) - oldcmid = models.BigIntegerField() - oldinstance = models.BigIntegerField() - newcmid = models.BigIntegerField() - newinstance = models.BigIntegerField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignment_upgrade' - - -class MdlAssignsubmissionFile(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - submission = models.BigIntegerField() - numfiles = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignsubmission_file' - - -class MdlAssignsubmissionOnlinetext(models.Model): - id = models.BigIntegerField(primary_key=True) - assignment = models.BigIntegerField() - submission = models.BigIntegerField() - onlinetext = models.TextField(blank=True) - onlineformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_assignsubmission_onlinetext' - - -class MdlAttendance(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255, blank=True) - grade = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_attendance' - - -class MdlAttendanceLog(models.Model): - id = models.BigIntegerField(primary_key=True) - sessionid = models.BigIntegerField() - studentid = models.BigIntegerField() - statusid = models.BigIntegerField() - statusset = models.CharField(max_length=100, blank=True) - timetaken = models.BigIntegerField() - takenby = models.BigIntegerField() - remarks = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_attendance_log' - - -class MdlAttendanceSessions(models.Model): - id = models.BigIntegerField(primary_key=True) - attendanceid = models.BigIntegerField() - groupid = models.BigIntegerField() - sessdate = models.BigIntegerField() - duration = models.BigIntegerField() - lasttaken = models.BigIntegerField(blank=True, null=True) - lasttakenby = models.BigIntegerField() - timemodified = models.BigIntegerField(blank=True, null=True) - description = models.TextField() - descriptionformat = models.SmallIntegerField() - studentscanmark = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_attendance_sessions' - - -class MdlAttendanceStatuses(models.Model): - id = models.BigIntegerField(primary_key=True) - attendanceid = models.BigIntegerField() - acronym = models.CharField(max_length=2) - description = models.CharField(max_length=30) - grade = models.SmallIntegerField() - visible = models.SmallIntegerField() - deleted = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_attendance_statuses' - - -class MdlBackupControllers(models.Model): - id = models.BigIntegerField(primary_key=True) - backupid = models.CharField(unique=True, max_length=32) - type = models.CharField(max_length=10) - itemid = models.BigIntegerField() - format = models.CharField(max_length=20) - interactive = models.SmallIntegerField() - purpose = models.SmallIntegerField() - userid = models.BigIntegerField() - status = models.SmallIntegerField() - execution = models.SmallIntegerField() - executiontime = models.BigIntegerField() - checksum = models.CharField(max_length=32) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - controller = models.TextField() - operation = models.CharField(max_length=20) - - class Meta: - managed = False - db_table = 'mdl_backup_controllers' - - -class MdlBackupCourses(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField(unique=True) - laststarttime = models.BigIntegerField() - lastendtime = models.BigIntegerField() - laststatus = models.CharField(max_length=1) - nextstarttime = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_backup_courses' - - -class MdlBackupLogs(models.Model): - id = models.BigIntegerField(primary_key=True) - backupid = models.CharField(max_length=32) - loglevel = models.SmallIntegerField() - message = models.TextField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_backup_logs' - - -class MdlBadge(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - description = models.TextField(blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - usercreated = models.BigIntegerField() - usermodified = models.BigIntegerField() - issuername = models.CharField(max_length=255) - issuerurl = models.CharField(max_length=255) - issuercontact = models.CharField(max_length=255, blank=True) - expiredate = models.BigIntegerField(blank=True, null=True) - expireperiod = models.BigIntegerField(blank=True, null=True) - type = models.SmallIntegerField() - courseid = models.BigIntegerField(blank=True, null=True) - message = models.TextField() - messagesubject = models.TextField() - attachment = models.SmallIntegerField() - notification = models.SmallIntegerField() - status = models.SmallIntegerField() - nextcron = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_badge' - - -class MdlBadgeBackpack(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - email = models.CharField(max_length=100) - backpackurl = models.CharField(max_length=255) - backpackuid = models.BigIntegerField() - autosync = models.SmallIntegerField() - password = models.CharField(max_length=50, blank=True) - - class Meta: - managed = False - db_table = 'mdl_badge_backpack' - - -class MdlBadgeCriteria(models.Model): - id = models.BigIntegerField(primary_key=True) - badgeid = models.BigIntegerField() - criteriatype = models.BigIntegerField(blank=True, null=True) - method = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_badge_criteria' - - -class MdlBadgeCriteriaMet(models.Model): - id = models.BigIntegerField(primary_key=True) - issuedid = models.BigIntegerField(blank=True, null=True) - critid = models.BigIntegerField() - userid = models.BigIntegerField() - datemet = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_badge_criteria_met' - - -class MdlBadgeCriteriaParam(models.Model): - id = models.BigIntegerField(primary_key=True) - critid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_badge_criteria_param' - - -class MdlBadgeExternal(models.Model): - id = models.BigIntegerField(primary_key=True) - backpackid = models.BigIntegerField() - collectionid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_badge_external' - - -class MdlBadgeIssued(models.Model): - id = models.BigIntegerField(primary_key=True) - badgeid = models.BigIntegerField() - userid = models.BigIntegerField() - uniquehash = models.TextField() - dateissued = models.BigIntegerField() - dateexpire = models.BigIntegerField(blank=True, null=True) - visible = models.SmallIntegerField() - issuernotified = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_badge_issued' - - -class MdlBadgeManualAward(models.Model): - id = models.BigIntegerField(primary_key=True) - badgeid = models.BigIntegerField() - recipientid = models.BigIntegerField() - issuerid = models.BigIntegerField() - issuerrole = models.BigIntegerField() - datemet = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_badge_manual_award' - - -class MdlBlock(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=40) - cron = models.BigIntegerField() - lastcron = models.BigIntegerField() - visible = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_block' - - -class MdlBlockCommunity(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - coursename = models.CharField(max_length=255) - coursedescription = models.TextField(blank=True) - courseurl = models.CharField(max_length=255) - imageurl = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_block_community' - - -class MdlBlockConfigurableReports(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - ownerid = models.BigIntegerField() - visible = models.SmallIntegerField() - name = models.CharField(max_length=128) - summary = models.TextField(blank=True) - type = models.CharField(max_length=128) - pagination = models.SmallIntegerField(blank=True, null=True) - components = models.TextField(blank=True) - export = models.CharField(max_length=255, blank=True) - jsordering = models.SmallIntegerField(blank=True, null=True) - global_field = models.SmallIntegerField(db_column='global', blank=True, null=True) # Field renamed because it was a Python reserved word. - lastexecutiontime = models.BigIntegerField(blank=True, null=True) - cron = models.BigIntegerField(blank=True, null=True) - remote = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_block_configurable_reports' - - -class MdlBlockInstances(models.Model): - id = models.BigIntegerField(primary_key=True) - pagetypepattern = models.CharField(max_length=64) - defaultregion = models.CharField(max_length=16) - configdata = models.TextField(blank=True) - defaultweight = models.BigIntegerField() - blockname = models.CharField(max_length=40) - parentcontextid = models.BigIntegerField() - showinsubcontexts = models.SmallIntegerField() - subpagepattern = models.CharField(max_length=16, blank=True) - - class Meta: - managed = False - db_table = 'mdl_block_instances' - - -class MdlBlockPositions(models.Model): - id = models.BigIntegerField(primary_key=True) - blockinstanceid = models.BigIntegerField() - contextid = models.BigIntegerField() - pagetype = models.CharField(max_length=64) - subpage = models.CharField(max_length=16) - visible = models.SmallIntegerField() - region = models.CharField(max_length=16) - weight = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_block_positions' - - -class MdlBlockRecentActivity(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - cmid = models.BigIntegerField() - timecreated = models.BigIntegerField() - userid = models.BigIntegerField() - action = models.SmallIntegerField() - modname = models.CharField(max_length=20, blank=True) - - class Meta: - managed = False - db_table = 'mdl_block_recent_activity' - - -class MdlBlockRssClient(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - title = models.TextField() - preferredtitle = models.CharField(max_length=64) - description = models.TextField() - shared = models.SmallIntegerField() - url = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_block_rss_client' - - -class MdlBlogAssociation(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - blogid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_blog_association' - - -class MdlBlogExternal(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - name = models.CharField(max_length=255) - description = models.TextField(blank=True) - url = models.TextField() - filtertags = models.CharField(max_length=255, blank=True) - failedlastsync = models.SmallIntegerField() - timemodified = models.BigIntegerField(blank=True, null=True) - timefetched = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_blog_external' - - -class MdlBook(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - numbering = models.SmallIntegerField() - customtitles = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - introformat = models.SmallIntegerField() - revision = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_book' - - -class MdlBookChapters(models.Model): - id = models.BigIntegerField(primary_key=True) - bookid = models.BigIntegerField() - pagenum = models.BigIntegerField() - subchapter = models.BigIntegerField() - title = models.CharField(max_length=255) - content = models.TextField() - hidden = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - importsrc = models.CharField(max_length=255) - contentformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_book_chapters' - - -class MdlCacheFilters(models.Model): - id = models.BigIntegerField(primary_key=True) - filter = models.CharField(max_length=32) - version = models.BigIntegerField() - md5key = models.CharField(max_length=32) - rawtext = models.TextField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_cache_filters' - - -class MdlCacheFlags(models.Model): - id = models.BigIntegerField(primary_key=True) - flagtype = models.CharField(max_length=255) - name = models.CharField(max_length=255) - timemodified = models.BigIntegerField() - value = models.TextField() - expiry = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_cache_flags' - - -class MdlCapabilities(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=255) - captype = models.CharField(max_length=50) - contextlevel = models.BigIntegerField() - component = models.CharField(max_length=100) - riskbitmask = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_capabilities' - - -class MdlCertificate(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - emailteachers = models.SmallIntegerField() - emailothers = models.TextField(blank=True) - savecert = models.SmallIntegerField() - reportcert = models.SmallIntegerField() - delivery = models.SmallIntegerField() - certificatetype = models.CharField(max_length=50) - borderstyle = models.CharField(max_length=255) - bordercolor = models.CharField(max_length=30) - printwmark = models.CharField(max_length=255) - printdate = models.BigIntegerField() - datefmt = models.BigIntegerField() - printnumber = models.SmallIntegerField() - printgrade = models.BigIntegerField() - gradefmt = models.BigIntegerField() - printoutcome = models.BigIntegerField() - printhours = models.CharField(max_length=255, blank=True) - printteacher = models.BigIntegerField() - customtext = models.TextField(blank=True) - printsignature = models.CharField(max_length=255) - printseal = models.CharField(max_length=255) - timemodified = models.BigIntegerField() - introformat = models.SmallIntegerField() - orientation = models.CharField(max_length=10) - requiredtime = models.BigIntegerField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_certificate' - - -class MdlCertificateIssues(models.Model): - id = models.BigIntegerField(primary_key=True) - certificateid = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - code = models.CharField(max_length=40, blank=True) - - class Meta: - managed = False - db_table = 'mdl_certificate_issues' - - -class MdlChat(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - keepdays = models.BigIntegerField() - studentlogs = models.SmallIntegerField() - chattime = models.BigIntegerField() - schedule = models.SmallIntegerField() - timemodified = models.BigIntegerField() - introformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_chat' - - -class MdlChatMessages(models.Model): - id = models.BigIntegerField(primary_key=True) - chatid = models.BigIntegerField() - userid = models.BigIntegerField() - groupid = models.BigIntegerField() - system = models.SmallIntegerField() - message = models.TextField() - timestamp = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_chat_messages' - - -class MdlChatMessagesCurrent(models.Model): - id = models.BigIntegerField(primary_key=True) - chatid = models.BigIntegerField() - userid = models.BigIntegerField() - groupid = models.BigIntegerField() - system = models.SmallIntegerField() - message = models.TextField() - timestamp = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_chat_messages_current' - - -class MdlChatUsers(models.Model): - id = models.BigIntegerField(primary_key=True) - chatid = models.BigIntegerField() - userid = models.BigIntegerField() - groupid = models.BigIntegerField() - version = models.CharField(max_length=16) - ip = models.CharField(max_length=45) - firstping = models.BigIntegerField() - lastping = models.BigIntegerField() - lastmessageping = models.BigIntegerField() - sid = models.CharField(max_length=32) - course = models.BigIntegerField() - lang = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_chat_users' - - -class MdlChoice(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - introformat = models.SmallIntegerField() - publish = models.SmallIntegerField() - showresults = models.SmallIntegerField() - display = models.SmallIntegerField() - allowupdate = models.SmallIntegerField() - showunanswered = models.SmallIntegerField() - limitanswers = models.SmallIntegerField() - timeopen = models.BigIntegerField() - timeclose = models.BigIntegerField() - timemodified = models.BigIntegerField() - completionsubmit = models.SmallIntegerField() - allowmultiple = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_choice' - - -class MdlChoiceAnswers(models.Model): - id = models.BigIntegerField(primary_key=True) - choiceid = models.BigIntegerField() - userid = models.BigIntegerField() - optionid = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_choice_answers' - - -class MdlChoiceOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - choiceid = models.BigIntegerField() - text = models.TextField(blank=True) - maxanswers = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_choice_options' - - -class MdlCohort(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - name = models.CharField(max_length=254) - idnumber = models.CharField(max_length=100, blank=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField() - component = models.CharField(max_length=100) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - visible = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_cohort' - - -class MdlCohortMembers(models.Model): - id = models.BigIntegerField(primary_key=True) - cohortid = models.BigIntegerField() - userid = models.BigIntegerField() - timeadded = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_cohort_members' - - -class MdlComments(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - commentarea = models.CharField(max_length=255) - itemid = models.BigIntegerField() - content = models.TextField() - format = models.SmallIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_comments' - - -class MdlConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=255) - value = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_config' - - -class MdlConfigLog(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - timemodified = models.BigIntegerField() - plugin = models.CharField(max_length=100, blank=True) - name = models.CharField(max_length=100) - value = models.TextField(blank=True) - oldvalue = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_config_log' - - -class MdlConfigPlugins(models.Model): - id = models.BigIntegerField(primary_key=True) - plugin = models.CharField(max_length=100) - name = models.CharField(max_length=100) - value = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_config_plugins' - - -class MdlContext(models.Model): - id = models.BigIntegerField(primary_key=True) - contextlevel = models.BigIntegerField() - instanceid = models.BigIntegerField() - path = models.CharField(max_length=255, blank=True) - depth = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_context' - - -class MdlContextTemp(models.Model): - id = models.BigIntegerField(primary_key=True) - path = models.CharField(max_length=255) - depth = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_context_temp' - - -class MdlCourse(models.Model): - id = models.BigIntegerField(primary_key=True) - category = models.BigIntegerField() - sortorder = models.BigIntegerField() - fullname = models.CharField(max_length=254) - shortname = models.CharField(max_length=255) - idnumber = models.CharField(max_length=100) - summary = models.TextField(blank=True) - format = models.CharField(max_length=21) - showgrades = models.SmallIntegerField() - newsitems = models.IntegerField() - startdate = models.BigIntegerField() - marker = models.BigIntegerField() - maxbytes = models.BigIntegerField() - showreports = models.SmallIntegerField() - visible = models.SmallIntegerField() - groupmode = models.SmallIntegerField() - groupmodeforce = models.SmallIntegerField() - lang = models.CharField(max_length=30) - theme = models.CharField(max_length=50) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - requested = models.SmallIntegerField() - defaultgroupingid = models.BigIntegerField() - enrolmax = models.BigIntegerField() - enablecompletion = models.SmallIntegerField() - legacyfiles = models.SmallIntegerField() - summaryformat = models.SmallIntegerField() - completionnotify = models.SmallIntegerField() - visibleold = models.SmallIntegerField() - calendartype = models.CharField(max_length=30) - cacherev = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_course' - - -class MdlCourseCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - description = models.TextField(blank=True) - parent = models.BigIntegerField() - sortorder = models.BigIntegerField() - coursecount = models.BigIntegerField() - visible = models.SmallIntegerField() - timemodified = models.BigIntegerField() - depth = models.BigIntegerField() - path = models.CharField(max_length=255) - theme = models.CharField(max_length=50, blank=True) - descriptionformat = models.SmallIntegerField() - visibleold = models.SmallIntegerField() - idnumber = models.CharField(max_length=100, blank=True) - - class Meta: - managed = False - db_table = 'mdl_course_categories' - - -class MdlCourseCompletionAggrMethd(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - criteriatype = models.BigIntegerField(blank=True, null=True) - method = models.SmallIntegerField() - value = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_course_completion_aggr_methd' - - -class MdlCourseCompletionCritCompl(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - course = models.BigIntegerField() - criteriaid = models.BigIntegerField() - gradefinal = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - unenroled = models.BigIntegerField(blank=True, null=True) - timecompleted = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_course_completion_crit_compl' - - -class MdlCourseCompletionCriteria(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - criteriatype = models.BigIntegerField() - module = models.CharField(max_length=100, blank=True) - moduleinstance = models.BigIntegerField(blank=True, null=True) - courseinstance = models.BigIntegerField(blank=True, null=True) - enrolperiod = models.BigIntegerField(blank=True, null=True) - timeend = models.BigIntegerField(blank=True, null=True) - gradepass = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - role = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_course_completion_criteria' - - -class MdlCourseCompletions(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - course = models.BigIntegerField() - timeenrolled = models.BigIntegerField() - timestarted = models.BigIntegerField() - timecompleted = models.BigIntegerField(blank=True, null=True) - reaggregate = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_course_completions' - - -class MdlCourseFormatOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - format = models.CharField(max_length=21) - sectionid = models.BigIntegerField() - name = models.CharField(max_length=100) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_course_format_options' - - -class MdlCourseModules(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - module = models.BigIntegerField() - instance = models.BigIntegerField() - section = models.BigIntegerField() - added = models.BigIntegerField() - score = models.SmallIntegerField() - indent = models.IntegerField() - visible = models.SmallIntegerField() - visibleold = models.SmallIntegerField() - groupmode = models.SmallIntegerField() - idnumber = models.CharField(max_length=100, blank=True) - groupingid = models.BigIntegerField() - completion = models.SmallIntegerField() - completiongradeitemnumber = models.BigIntegerField(blank=True, null=True) - completionview = models.SmallIntegerField() - completionexpected = models.BigIntegerField() - showdescription = models.SmallIntegerField() - availability = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_course_modules' - - -class MdlCourseModulesCompletion(models.Model): - id = models.BigIntegerField(primary_key=True) - coursemoduleid = models.BigIntegerField() - userid = models.BigIntegerField() - completionstate = models.SmallIntegerField() - viewed = models.SmallIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_course_modules_completion' - - -class MdlCoursePublished(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - timepublished = models.BigIntegerField() - enrollable = models.SmallIntegerField() - hubcourseid = models.BigIntegerField() - status = models.SmallIntegerField(blank=True, null=True) - timechecked = models.BigIntegerField(blank=True, null=True) - huburl = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_course_published' - - -class MdlCourseRequest(models.Model): - id = models.BigIntegerField(primary_key=True) - fullname = models.CharField(max_length=254) - shortname = models.CharField(max_length=100) - summary = models.TextField() - reason = models.TextField() - requester = models.BigIntegerField() - password = models.CharField(max_length=50) - summaryformat = models.SmallIntegerField() - category = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_course_request' - - -class MdlCourseSections(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - section = models.BigIntegerField() - summary = models.TextField(blank=True) - sequence = models.TextField(blank=True) - visible = models.SmallIntegerField() - name = models.CharField(max_length=255, blank=True) - summaryformat = models.SmallIntegerField() - availability = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_course_sections' - - -class MdlData(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - comments = models.SmallIntegerField() - timeavailablefrom = models.BigIntegerField() - timeavailableto = models.BigIntegerField() - timeviewfrom = models.BigIntegerField() - timeviewto = models.BigIntegerField() - requiredentries = models.IntegerField() - requiredentriestoview = models.IntegerField() - maxentries = models.IntegerField() - rssarticles = models.SmallIntegerField() - singletemplate = models.TextField(blank=True) - listtemplate = models.TextField(blank=True) - listtemplateheader = models.TextField(blank=True) - listtemplatefooter = models.TextField(blank=True) - addtemplate = models.TextField(blank=True) - rsstemplate = models.TextField(blank=True) - rsstitletemplate = models.TextField(blank=True) - csstemplate = models.TextField(blank=True) - jstemplate = models.TextField(blank=True) - approval = models.SmallIntegerField() - scale = models.BigIntegerField() - assessed = models.BigIntegerField() - defaultsort = models.BigIntegerField() - defaultsortdir = models.SmallIntegerField() - editany = models.SmallIntegerField() - asearchtemplate = models.TextField(blank=True) - notification = models.BigIntegerField() - introformat = models.SmallIntegerField() - assesstimestart = models.BigIntegerField() - assesstimefinish = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_data' - - -class MdlDataContent(models.Model): - id = models.BigIntegerField(primary_key=True) - fieldid = models.BigIntegerField() - recordid = models.BigIntegerField() - content = models.TextField(blank=True) - content1 = models.TextField(blank=True) - content2 = models.TextField(blank=True) - content3 = models.TextField(blank=True) - content4 = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_data_content' - - -class MdlDataFields(models.Model): - id = models.BigIntegerField(primary_key=True) - dataid = models.BigIntegerField() - type = models.CharField(max_length=255) - name = models.CharField(max_length=255) - description = models.TextField() - param1 = models.TextField(blank=True) - param2 = models.TextField(blank=True) - param3 = models.TextField(blank=True) - param4 = models.TextField(blank=True) - param5 = models.TextField(blank=True) - param6 = models.TextField(blank=True) - param7 = models.TextField(blank=True) - param8 = models.TextField(blank=True) - param9 = models.TextField(blank=True) - param10 = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_data_fields' - - -class MdlDataRecords(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - groupid = models.BigIntegerField() - dataid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - approved = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_data_records' - - -class MdlEditorAttoAutosave(models.Model): - id = models.BigIntegerField(primary_key=True) - elementid = models.CharField(max_length=255) - contextid = models.BigIntegerField() - pagehash = models.CharField(max_length=64) - userid = models.BigIntegerField() - drafttext = models.TextField() - draftid = models.BigIntegerField(blank=True, null=True) - pageinstance = models.CharField(max_length=64) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_editor_atto_autosave' - - -class MdlEnrol(models.Model): - id = models.BigIntegerField(primary_key=True) - enrol = models.CharField(max_length=20) - status = models.BigIntegerField() - courseid = models.BigIntegerField() - sortorder = models.BigIntegerField() - name = models.CharField(max_length=255, blank=True) - enrolperiod = models.BigIntegerField(blank=True, null=True) - enrolstartdate = models.BigIntegerField(blank=True, null=True) - enrolenddate = models.BigIntegerField(blank=True, null=True) - expirynotify = models.SmallIntegerField(blank=True, null=True) - expirythreshold = models.BigIntegerField(blank=True, null=True) - notifyall = models.SmallIntegerField(blank=True, null=True) - password = models.CharField(max_length=50, blank=True) - cost = models.CharField(max_length=20, blank=True) - currency = models.CharField(max_length=3, blank=True) - roleid = models.BigIntegerField(blank=True, null=True) - customint1 = models.BigIntegerField(blank=True, null=True) - customint2 = models.BigIntegerField(blank=True, null=True) - customint3 = models.BigIntegerField(blank=True, null=True) - customint4 = models.BigIntegerField(blank=True, null=True) - customchar1 = models.CharField(max_length=255, blank=True) - customchar2 = models.CharField(max_length=255, blank=True) - customdec1 = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - customdec2 = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - customtext1 = models.TextField(blank=True) - customtext2 = models.TextField(blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - customint5 = models.BigIntegerField(blank=True, null=True) - customint6 = models.BigIntegerField(blank=True, null=True) - customint7 = models.BigIntegerField(blank=True, null=True) - customint8 = models.BigIntegerField(blank=True, null=True) - customchar3 = models.CharField(max_length=1333, blank=True) - customtext3 = models.TextField(blank=True) - customtext4 = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_enrol' - - -class MdlEnrolFlatfile(models.Model): - id = models.BigIntegerField(primary_key=True) - action = models.CharField(max_length=30) - roleid = models.BigIntegerField() - userid = models.BigIntegerField() - courseid = models.BigIntegerField() - timestart = models.BigIntegerField() - timeend = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_enrol_flatfile' - - -class MdlEnrolPaypal(models.Model): - id = models.BigIntegerField(primary_key=True) - business = models.CharField(max_length=255) - receiver_email = models.CharField(max_length=255) - receiver_id = models.CharField(max_length=255) - item_name = models.CharField(max_length=255) - courseid = models.BigIntegerField() - userid = models.BigIntegerField() - memo = models.CharField(max_length=255) - tax = models.CharField(max_length=255) - option_name1 = models.CharField(max_length=255) - option_selection1_x = models.CharField(max_length=255) - option_name2 = models.CharField(max_length=255) - option_selection2_x = models.CharField(max_length=255) - payment_status = models.CharField(max_length=255) - pending_reason = models.CharField(max_length=255) - reason_code = models.CharField(max_length=30) - txn_id = models.CharField(max_length=255) - parent_txn_id = models.CharField(max_length=255) - payment_type = models.CharField(max_length=30) - timeupdated = models.BigIntegerField() - instanceid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_enrol_paypal' - - -class MdlEvent(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.TextField() - description = models.TextField() - format = models.SmallIntegerField() - courseid = models.BigIntegerField() - groupid = models.BigIntegerField() - userid = models.BigIntegerField() - repeatid = models.BigIntegerField() - modulename = models.CharField(max_length=20) - instance = models.BigIntegerField() - eventtype = models.CharField(max_length=20) - timestart = models.BigIntegerField() - timeduration = models.BigIntegerField() - visible = models.SmallIntegerField() - uuid = models.CharField(max_length=255) - sequence = models.BigIntegerField() - timemodified = models.BigIntegerField() - subscriptionid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_event' - - -class MdlEventSubscriptions(models.Model): - id = models.BigIntegerField(primary_key=True) - url = models.CharField(max_length=255) - courseid = models.BigIntegerField() - groupid = models.BigIntegerField() - userid = models.BigIntegerField() - pollinterval = models.BigIntegerField() - lastupdated = models.BigIntegerField(blank=True, null=True) - name = models.CharField(max_length=255) - eventtype = models.CharField(max_length=20) - - class Meta: - managed = False - db_table = 'mdl_event_subscriptions' - - -class MdlEventsHandlers(models.Model): - id = models.BigIntegerField(primary_key=True) - eventname = models.CharField(max_length=166) - component = models.CharField(max_length=166) - handlerfile = models.CharField(max_length=255) - handlerfunction = models.TextField(blank=True) - schedule = models.CharField(max_length=255, blank=True) - status = models.BigIntegerField() - internal = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_events_handlers' - - -class MdlEventsQueue(models.Model): - id = models.BigIntegerField(primary_key=True) - eventdata = models.TextField() - stackdump = models.TextField(blank=True) - userid = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_events_queue' - - -class MdlEventsQueueHandlers(models.Model): - id = models.BigIntegerField(primary_key=True) - queuedeventid = models.BigIntegerField() - handlerid = models.BigIntegerField() - status = models.BigIntegerField(blank=True, null=True) - errormessage = models.TextField(blank=True) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_events_queue_handlers' - - -class MdlExternalFunctions(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=200) - classname = models.CharField(max_length=100) - methodname = models.CharField(max_length=100) - classpath = models.CharField(max_length=255, blank=True) - component = models.CharField(max_length=100) - capabilities = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_external_functions' - - -class MdlExternalServices(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=200) - enabled = models.SmallIntegerField() - requiredcapability = models.CharField(max_length=150, blank=True) - restrictedusers = models.SmallIntegerField() - component = models.CharField(max_length=100, blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField(blank=True, null=True) - shortname = models.CharField(max_length=255, blank=True) - downloadfiles = models.SmallIntegerField() - uploadfiles = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_external_services' - - -class MdlExternalServicesFunctions(models.Model): - id = models.BigIntegerField(primary_key=True) - externalserviceid = models.BigIntegerField() - functionname = models.CharField(max_length=200) - - class Meta: - managed = False - db_table = 'mdl_external_services_functions' - - -class MdlExternalServicesUsers(models.Model): - id = models.BigIntegerField(primary_key=True) - externalserviceid = models.BigIntegerField() - userid = models.BigIntegerField() - iprestriction = models.CharField(max_length=255, blank=True) - validuntil = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_external_services_users' - - -class MdlExternalTokens(models.Model): - id = models.BigIntegerField(primary_key=True) - token = models.CharField(max_length=128) - tokentype = models.SmallIntegerField() - userid = models.BigIntegerField() - externalserviceid = models.BigIntegerField() - sid = models.CharField(max_length=128, blank=True) - contextid = models.BigIntegerField() - creatorid = models.BigIntegerField() - iprestriction = models.CharField(max_length=255, blank=True) - validuntil = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField() - lastaccess = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_external_tokens' - - -class MdlFeedback(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - introformat = models.SmallIntegerField() - anonymous = models.SmallIntegerField() - email_notification = models.SmallIntegerField() - multiple_submit = models.SmallIntegerField() - autonumbering = models.SmallIntegerField() - site_after_submit = models.CharField(max_length=255) - page_after_submit = models.TextField() - page_after_submitformat = models.SmallIntegerField() - publish_stats = models.SmallIntegerField() - timeopen = models.BigIntegerField() - timeclose = models.BigIntegerField() - timemodified = models.BigIntegerField() - completionsubmit = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_feedback' - - -class MdlFeedbackCompleted(models.Model): - id = models.BigIntegerField(primary_key=True) - feedback = models.BigIntegerField() - userid = models.BigIntegerField() - timemodified = models.BigIntegerField() - random_response = models.BigIntegerField() - anonymous_response = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_feedback_completed' - - -class MdlFeedbackCompletedtmp(models.Model): - id = models.BigIntegerField(primary_key=True) - feedback = models.BigIntegerField() - userid = models.BigIntegerField() - guestid = models.CharField(max_length=255) - timemodified = models.BigIntegerField() - random_response = models.BigIntegerField() - anonymous_response = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_feedback_completedtmp' - - -class MdlFeedbackItem(models.Model): - id = models.BigIntegerField(primary_key=True) - feedback = models.BigIntegerField() - template = models.BigIntegerField() - name = models.CharField(max_length=255) - label = models.CharField(max_length=255) - presentation = models.TextField() - typ = models.CharField(max_length=255) - hasvalue = models.SmallIntegerField() - position = models.SmallIntegerField() - required = models.SmallIntegerField() - dependitem = models.BigIntegerField() - dependvalue = models.CharField(max_length=255) - options = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_feedback_item' - - -class MdlFeedbackSitecourseMap(models.Model): - id = models.BigIntegerField(primary_key=True) - feedbackid = models.BigIntegerField() - courseid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_feedback_sitecourse_map' - - -class MdlFeedbackTemplate(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - ispublic = models.SmallIntegerField() - name = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_feedback_template' - - -class MdlFeedbackTracking(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - feedback = models.BigIntegerField() - completed = models.BigIntegerField() - tmp_completed = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_feedback_tracking' - - -class MdlFeedbackValue(models.Model): - id = models.BigIntegerField(primary_key=True) - course_id = models.BigIntegerField() - item = models.BigIntegerField() - completed = models.BigIntegerField() - tmp_completed = models.BigIntegerField() - value = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_feedback_value' - - -class MdlFeedbackValuetmp(models.Model): - id = models.BigIntegerField(primary_key=True) - course_id = models.BigIntegerField() - item = models.BigIntegerField() - completed = models.BigIntegerField() - tmp_completed = models.BigIntegerField() - value = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_feedback_valuetmp' - - -class MdlFiles(models.Model): - id = models.BigIntegerField(primary_key=True) - contenthash = models.CharField(max_length=40) - pathnamehash = models.CharField(unique=True, max_length=40) - contextid = models.BigIntegerField() - component = models.CharField(max_length=100) - filearea = models.CharField(max_length=50) - itemid = models.BigIntegerField() - filepath = models.CharField(max_length=255) - filename = models.CharField(max_length=255) - userid = models.BigIntegerField(blank=True, null=True) - filesize = models.BigIntegerField() - mimetype = models.CharField(max_length=100, blank=True) - status = models.BigIntegerField() - source = models.TextField(blank=True) - author = models.CharField(max_length=255, blank=True) - license = models.CharField(max_length=255, blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - sortorder = models.BigIntegerField() - referencefileid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_files' - - -class MdlFilesReference(models.Model): - id = models.BigIntegerField(primary_key=True) - repositoryid = models.BigIntegerField() - lastsync = models.BigIntegerField(blank=True, null=True) - reference = models.TextField(blank=True) - referencehash = models.CharField(max_length=40) - - class Meta: - managed = False - db_table = 'mdl_files_reference' - - -class MdlFilterActive(models.Model): - id = models.BigIntegerField(primary_key=True) - filter = models.CharField(max_length=32) - contextid = models.BigIntegerField() - active = models.SmallIntegerField() - sortorder = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_filter_active' - - -class MdlFilterConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - filter = models.CharField(max_length=32) - contextid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_filter_config' - - -class MdlFolder(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - revision = models.BigIntegerField() - timemodified = models.BigIntegerField() - display = models.SmallIntegerField() - showexpanded = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_folder' - - -class MdlFormatPage(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - nameone = models.CharField(max_length=128, blank=True) - nametwo = models.CharField(max_length=128, blank=True) - display = models.BigIntegerField(blank=True, null=True) - prefleftwidth = models.SmallIntegerField(blank=True, null=True) - prefcenterwidth = models.SmallIntegerField(blank=True, null=True) - prefrightwidth = models.SmallIntegerField(blank=True, null=True) - parent = models.BigIntegerField(blank=True, null=True) - sortorder = models.SmallIntegerField(blank=True, null=True) - template = models.SmallIntegerField(blank=True, null=True) - showbuttons = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_format_page' - - -class MdlFormatPageItems(models.Model): - id = models.BigIntegerField(primary_key=True) - pageid = models.BigIntegerField() - cmid = models.BigIntegerField() - blockinstance = models.BigIntegerField() - position = models.CharField(max_length=3) - sortorder = models.SmallIntegerField() - visible = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_format_page_items' - - -class MdlForum(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - type = models.CharField(max_length=20) - name = models.CharField(max_length=255) - intro = models.TextField() - assessed = models.BigIntegerField() - assesstimestart = models.BigIntegerField() - assesstimefinish = models.BigIntegerField() - scale = models.BigIntegerField() - maxbytes = models.BigIntegerField() - forcesubscribe = models.SmallIntegerField() - trackingtype = models.SmallIntegerField() - rsstype = models.SmallIntegerField() - rssarticles = models.SmallIntegerField() - timemodified = models.BigIntegerField() - warnafter = models.BigIntegerField() - blockafter = models.BigIntegerField() - blockperiod = models.BigIntegerField() - completiondiscussions = models.IntegerField() - completionreplies = models.IntegerField() - completionposts = models.IntegerField() - maxattachments = models.BigIntegerField() - introformat = models.SmallIntegerField() - displaywordcount = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum' - - -class MdlForumDigests(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - forum = models.BigIntegerField() - maildigest = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_digests' - - -class MdlForumDiscussionSubs(models.Model): - id = models.BigIntegerField(primary_key=True) - forum = models.BigIntegerField() - userid = models.BigIntegerField() - discussion = models.BigIntegerField() - preference = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_discussion_subs' - - -class MdlForumDiscussions(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - forum = models.BigIntegerField() - name = models.CharField(max_length=255) - firstpost = models.BigIntegerField() - userid = models.BigIntegerField() - groupid = models.BigIntegerField() - assessed = models.SmallIntegerField() - timemodified = models.BigIntegerField() - usermodified = models.BigIntegerField() - timestart = models.BigIntegerField() - timeend = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_discussions' - - -class MdlForumPosts(models.Model): - id = models.BigIntegerField(primary_key=True) - discussion = models.BigIntegerField() - parent = models.BigIntegerField() - userid = models.BigIntegerField() - created = models.BigIntegerField() - modified = models.BigIntegerField() - mailed = models.SmallIntegerField() - subject = models.CharField(max_length=255) - message = models.TextField() - messageformat = models.SmallIntegerField() - attachment = models.CharField(max_length=100) - totalscore = models.SmallIntegerField() - mailnow = models.BigIntegerField() - messagetrust = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_posts' - - -class MdlForumQueue(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - discussionid = models.BigIntegerField() - postid = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_queue' - - -class MdlForumRead(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - forumid = models.BigIntegerField() - discussionid = models.BigIntegerField() - postid = models.BigIntegerField() - firstread = models.BigIntegerField() - lastread = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_read' - - -class MdlForumSubscriptions(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - forum = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_subscriptions' - - -class MdlForumTrackPrefs(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - forumid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_forum_track_prefs' - - -class MdlGlossary(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - allowduplicatedentries = models.SmallIntegerField() - displayformat = models.CharField(max_length=50) - mainglossary = models.SmallIntegerField() - showspecial = models.SmallIntegerField() - showalphabet = models.SmallIntegerField() - showall = models.SmallIntegerField() - allowcomments = models.SmallIntegerField() - allowprintview = models.SmallIntegerField() - usedynalink = models.SmallIntegerField() - defaultapproval = models.SmallIntegerField() - globalglossary = models.SmallIntegerField() - entbypage = models.SmallIntegerField() - editalways = models.SmallIntegerField() - rsstype = models.SmallIntegerField() - rssarticles = models.SmallIntegerField() - assessed = models.BigIntegerField() - assesstimestart = models.BigIntegerField() - assesstimefinish = models.BigIntegerField() - scale = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - introformat = models.SmallIntegerField() - completionentries = models.IntegerField() - approvaldisplayformat = models.CharField(max_length=50) - - class Meta: - managed = False - db_table = 'mdl_glossary' - - -class MdlGlossaryAlias(models.Model): - id = models.BigIntegerField(primary_key=True) - entryid = models.BigIntegerField() - alias = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_glossary_alias' - - -class MdlGlossaryCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - glossaryid = models.BigIntegerField() - name = models.CharField(max_length=255) - usedynalink = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_glossary_categories' - - -class MdlGlossaryEntries(models.Model): - id = models.BigIntegerField(primary_key=True) - glossaryid = models.BigIntegerField() - userid = models.BigIntegerField() - concept = models.CharField(max_length=255) - definition = models.TextField() - definitionformat = models.SmallIntegerField() - attachment = models.CharField(max_length=100) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - teacherentry = models.SmallIntegerField() - sourceglossaryid = models.BigIntegerField() - usedynalink = models.SmallIntegerField() - casesensitive = models.SmallIntegerField() - fullmatch = models.SmallIntegerField() - approved = models.SmallIntegerField() - definitiontrust = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_glossary_entries' - - -class MdlGlossaryEntriesCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - categoryid = models.BigIntegerField() - entryid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_glossary_entries_categories' - - -class MdlGlossaryFormats(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=50) - popupformatname = models.CharField(max_length=50) - visible = models.SmallIntegerField() - showgroup = models.SmallIntegerField() - defaultmode = models.CharField(max_length=50) - defaulthook = models.CharField(max_length=50) - sortkey = models.CharField(max_length=50) - sortorder = models.CharField(max_length=50) - - class Meta: - managed = False - db_table = 'mdl_glossary_formats' - - -class MdlGradeCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - parent = models.BigIntegerField(blank=True, null=True) - depth = models.BigIntegerField() - path = models.CharField(max_length=255, blank=True) - fullname = models.CharField(max_length=255) - aggregation = models.BigIntegerField() - keephigh = models.BigIntegerField() - droplow = models.BigIntegerField() - aggregateonlygraded = models.SmallIntegerField() - aggregateoutcomes = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - hidden = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_categories' - - -class MdlGradeCategoriesHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - action = models.BigIntegerField() - oldid = models.BigIntegerField() - source = models.CharField(max_length=255, blank=True) - timemodified = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField() - parent = models.BigIntegerField(blank=True, null=True) - depth = models.BigIntegerField() - path = models.CharField(max_length=255, blank=True) - fullname = models.CharField(max_length=255) - aggregation = models.BigIntegerField() - keephigh = models.BigIntegerField() - droplow = models.BigIntegerField() - aggregateonlygraded = models.SmallIntegerField() - aggregateoutcomes = models.SmallIntegerField() - aggregatesubcats = models.SmallIntegerField() - hidden = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_categories_history' - - -class MdlGradeGrades(models.Model): - id = models.BigIntegerField(primary_key=True) - itemid = models.BigIntegerField() - userid = models.BigIntegerField() - rawgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - rawgrademax = models.DecimalField(max_digits=10, decimal_places=5) - rawgrademin = models.DecimalField(max_digits=10, decimal_places=5) - rawscaleid = models.BigIntegerField(blank=True, null=True) - usermodified = models.BigIntegerField(blank=True, null=True) - finalgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - hidden = models.BigIntegerField() - locked = models.BigIntegerField() - locktime = models.BigIntegerField() - exported = models.BigIntegerField() - overridden = models.BigIntegerField() - excluded = models.BigIntegerField() - feedback = models.TextField(blank=True) - feedbackformat = models.BigIntegerField() - information = models.TextField(blank=True) - informationformat = models.BigIntegerField() - timecreated = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - notacesar = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - aggregationstatus = models.CharField(max_length=10) - aggregationweight = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_grade_grades' - - -class MdlGradeGradesHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - action = models.BigIntegerField() - oldid = models.BigIntegerField() - source = models.CharField(max_length=255, blank=True) - timemodified = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - itemid = models.BigIntegerField() - userid = models.BigIntegerField() - rawgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - rawgrademax = models.DecimalField(max_digits=10, decimal_places=5) - rawgrademin = models.DecimalField(max_digits=10, decimal_places=5) - rawscaleid = models.BigIntegerField(blank=True, null=True) - usermodified = models.BigIntegerField(blank=True, null=True) - finalgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - hidden = models.BigIntegerField() - locked = models.BigIntegerField() - locktime = models.BigIntegerField() - exported = models.BigIntegerField() - overridden = models.BigIntegerField() - excluded = models.BigIntegerField() - feedback = models.TextField(blank=True) - feedbackformat = models.BigIntegerField() - information = models.TextField(blank=True) - informationformat = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_grades_history' - - -class MdlGradeImportNewitem(models.Model): - id = models.BigIntegerField(primary_key=True) - itemname = models.CharField(max_length=255) - importcode = models.BigIntegerField() - importer = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_import_newitem' - - -class MdlGradeImportValues(models.Model): - id = models.BigIntegerField(primary_key=True) - itemid = models.BigIntegerField(blank=True, null=True) - newgradeitem = models.BigIntegerField(blank=True, null=True) - userid = models.BigIntegerField() - finalgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - feedback = models.TextField(blank=True) - importcode = models.BigIntegerField() - importer = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_grade_import_values' - - -class MdlGradeItems(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField(blank=True, null=True) - categoryid = models.BigIntegerField(blank=True, null=True) - itemname = models.CharField(max_length=255, blank=True) - itemtype = models.CharField(max_length=30) - itemmodule = models.CharField(max_length=30, blank=True) - iteminstance = models.BigIntegerField(blank=True, null=True) - itemnumber = models.BigIntegerField(blank=True, null=True) - iteminfo = models.TextField(blank=True) - idnumber = models.CharField(max_length=255, blank=True) - calculation = models.TextField(blank=True) - gradetype = models.SmallIntegerField() - grademax = models.DecimalField(max_digits=10, decimal_places=5) - grademin = models.DecimalField(max_digits=10, decimal_places=5) - scaleid = models.BigIntegerField(blank=True, null=True) - outcomeid = models.BigIntegerField(blank=True, null=True) - gradepass = models.DecimalField(max_digits=10, decimal_places=5) - multfactor = models.DecimalField(max_digits=10, decimal_places=5) - plusfactor = models.DecimalField(max_digits=10, decimal_places=5) - aggregationcoef = models.DecimalField(max_digits=10, decimal_places=5) - sortorder = models.BigIntegerField() - hidden = models.BigIntegerField() - locked = models.BigIntegerField() - locktime = models.BigIntegerField() - needsupdate = models.BigIntegerField() - timecreated = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - display = models.BigIntegerField() - decimals = models.SmallIntegerField(blank=True, null=True) - aggregationcoef2 = models.DecimalField(max_digits=10, decimal_places=5) - weightoverride = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_items' - - -class MdlGradeItemsHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - action = models.BigIntegerField() - oldid = models.BigIntegerField() - source = models.CharField(max_length=255, blank=True) - timemodified = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField(blank=True, null=True) - categoryid = models.BigIntegerField(blank=True, null=True) - itemname = models.CharField(max_length=255, blank=True) - itemtype = models.CharField(max_length=30) - itemmodule = models.CharField(max_length=30, blank=True) - iteminstance = models.BigIntegerField(blank=True, null=True) - itemnumber = models.BigIntegerField(blank=True, null=True) - iteminfo = models.TextField(blank=True) - idnumber = models.CharField(max_length=255, blank=True) - calculation = models.TextField(blank=True) - gradetype = models.SmallIntegerField() - grademax = models.DecimalField(max_digits=10, decimal_places=5) - grademin = models.DecimalField(max_digits=10, decimal_places=5) - scaleid = models.BigIntegerField(blank=True, null=True) - outcomeid = models.BigIntegerField(blank=True, null=True) - gradepass = models.DecimalField(max_digits=10, decimal_places=5) - multfactor = models.DecimalField(max_digits=10, decimal_places=5) - plusfactor = models.DecimalField(max_digits=10, decimal_places=5) - aggregationcoef = models.DecimalField(max_digits=10, decimal_places=5) - sortorder = models.BigIntegerField() - display = models.BigIntegerField() - decimals = models.SmallIntegerField(blank=True, null=True) - hidden = models.BigIntegerField() - locked = models.BigIntegerField() - locktime = models.BigIntegerField() - needsupdate = models.BigIntegerField() - aggregationcoef2 = models.DecimalField(max_digits=10, decimal_places=5) - weightoverride = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_items_history' - - -class MdlGradeLetters(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - lowerboundary = models.DecimalField(max_digits=10, decimal_places=5) - letter = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_grade_letters' - - -class MdlGradeOutcomes(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField(blank=True, null=True) - shortname = models.CharField(max_length=255) - fullname = models.TextField() - scaleid = models.BigIntegerField(blank=True, null=True) - description = models.TextField(blank=True) - timecreated = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - usermodified = models.BigIntegerField(blank=True, null=True) - descriptionformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_outcomes' - - -class MdlGradeOutcomesCourses(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - outcomeid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_outcomes_courses' - - -class MdlGradeOutcomesHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - action = models.BigIntegerField() - oldid = models.BigIntegerField() - source = models.CharField(max_length=255, blank=True) - timemodified = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField(blank=True, null=True) - shortname = models.CharField(max_length=255) - fullname = models.TextField() - scaleid = models.BigIntegerField(blank=True, null=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grade_outcomes_history' - - -class MdlGradeSettings(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_grade_settings' - - -class MdlGradingAreas(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - component = models.CharField(max_length=100) - areaname = models.CharField(max_length=100) - activemethod = models.CharField(max_length=100, blank=True) - - class Meta: - managed = False - db_table = 'mdl_grading_areas' - - -class MdlGradingDefinitions(models.Model): - id = models.BigIntegerField(primary_key=True) - areaid = models.BigIntegerField() - method = models.CharField(max_length=100) - name = models.CharField(max_length=255) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - status = models.BigIntegerField() - copiedfromid = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField() - usercreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - usermodified = models.BigIntegerField() - timecopied = models.BigIntegerField(blank=True, null=True) - options = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_grading_definitions' - - -class MdlGradingInstances(models.Model): - id = models.BigIntegerField(primary_key=True) - definitionid = models.BigIntegerField() - raterid = models.BigIntegerField() - itemid = models.BigIntegerField(blank=True, null=True) - rawgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - status = models.BigIntegerField() - feedback = models.TextField(blank=True) - feedbackformat = models.SmallIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_grading_instances' - - -class MdlGradingformGuideComments(models.Model): - id = models.BigIntegerField(primary_key=True) - definitionid = models.BigIntegerField() - sortorder = models.BigIntegerField() - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_gradingform_guide_comments' - - -class MdlGradingformGuideCriteria(models.Model): - id = models.BigIntegerField(primary_key=True) - definitionid = models.BigIntegerField() - sortorder = models.BigIntegerField() - shortname = models.CharField(max_length=255) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - descriptionmarkers = models.TextField(blank=True) - descriptionmarkersformat = models.SmallIntegerField(blank=True, null=True) - maxscore = models.DecimalField(max_digits=10, decimal_places=5) - - class Meta: - managed = False - db_table = 'mdl_gradingform_guide_criteria' - - -class MdlGradingformGuideFillings(models.Model): - id = models.BigIntegerField(primary_key=True) - instanceid = models.BigIntegerField() - criterionid = models.BigIntegerField() - remark = models.TextField(blank=True) - remarkformat = models.SmallIntegerField(blank=True, null=True) - score = models.DecimalField(max_digits=10, decimal_places=5) - - class Meta: - managed = False - db_table = 'mdl_gradingform_guide_fillings' - - -class MdlGradingformRubricCriteria(models.Model): - id = models.BigIntegerField(primary_key=True) - definitionid = models.BigIntegerField() - sortorder = models.BigIntegerField() - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_gradingform_rubric_criteria' - - -class MdlGradingformRubricFillings(models.Model): - id = models.BigIntegerField(primary_key=True) - instanceid = models.BigIntegerField() - criterionid = models.BigIntegerField() - levelid = models.BigIntegerField(blank=True, null=True) - remark = models.TextField(blank=True) - remarkformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_gradingform_rubric_fillings' - - -class MdlGradingformRubricLevels(models.Model): - id = models.BigIntegerField(primary_key=True) - criterionid = models.BigIntegerField() - score = models.DecimalField(max_digits=10, decimal_places=5) - definition = models.TextField(blank=True) - definitionformat = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_gradingform_rubric_levels' - - -class MdlGroupings(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - description = models.TextField(blank=True) - timecreated = models.BigIntegerField() - courseid = models.BigIntegerField() - configdata = models.TextField(blank=True) - timemodified = models.BigIntegerField() - descriptionformat = models.SmallIntegerField() - idnumber = models.CharField(max_length=100) - - class Meta: - managed = False - db_table = 'mdl_groupings' - - -class MdlGroupingsGroups(models.Model): - id = models.BigIntegerField(primary_key=True) - groupingid = models.BigIntegerField() - groupid = models.BigIntegerField() - timeadded = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_groupings_groups' - - -class MdlGroups(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=254) - description = models.TextField(blank=True) - enrolmentkey = models.CharField(max_length=50, blank=True) - picture = models.BigIntegerField() - hidepicture = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - courseid = models.BigIntegerField() - descriptionformat = models.SmallIntegerField() - idnumber = models.CharField(max_length=100) - - class Meta: - managed = False - db_table = 'mdl_groups' - - -class MdlGroupsMembers(models.Model): - id = models.BigIntegerField(primary_key=True) - groupid = models.BigIntegerField() - userid = models.BigIntegerField() - timeadded = models.BigIntegerField() - component = models.CharField(max_length=100) - itemid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_groups_members' - - -class MdlHotpot(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - entrytext = models.TextField() - timeopen = models.BigIntegerField() - timeclose = models.BigIntegerField() - sourcelocation = models.SmallIntegerField() - sourcefile = models.CharField(max_length=255) - outputformat = models.CharField(max_length=255) - navigation = models.SmallIntegerField() - studentfeedback = models.SmallIntegerField() - studentfeedbackurl = models.CharField(max_length=255) - reviewoptions = models.BigIntegerField() - gradeweighting = models.BigIntegerField() - grademethod = models.SmallIntegerField() - attemptlimit = models.IntegerField() - password = models.CharField(max_length=255) - subnet = models.CharField(max_length=255) - clickreporting = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - sourcetype = models.CharField(max_length=255) - configfile = models.CharField(max_length=255) - configlocation = models.SmallIntegerField() - entrycm = models.BigIntegerField() - entrygrade = models.IntegerField() - entrypage = models.SmallIntegerField() - entryformat = models.SmallIntegerField() - entryoptions = models.BigIntegerField() - exitpage = models.SmallIntegerField() - exittext = models.TextField() - exitformat = models.SmallIntegerField() - exitoptions = models.BigIntegerField() - exitcm = models.BigIntegerField() - title = models.IntegerField() - stopbutton = models.SmallIntegerField() - stoptext = models.CharField(max_length=255) - usefilters = models.SmallIntegerField() - useglossary = models.SmallIntegerField() - usemediafilter = models.CharField(max_length=255) - timelimit = models.BigIntegerField() - delay1 = models.BigIntegerField() - delay2 = models.BigIntegerField() - delay3 = models.BigIntegerField() - discarddetails = models.SmallIntegerField() - exitgrade = models.IntegerField() - allowpaste = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_hotpot' - - -class MdlHotpotAttempts(models.Model): - id = models.BigIntegerField(primary_key=True) - hotpotid = models.BigIntegerField() - userid = models.BigIntegerField() - starttime = models.BigIntegerField() - endtime = models.BigIntegerField() - score = models.IntegerField() - penalties = models.IntegerField() - attempt = models.IntegerField() - timestart = models.BigIntegerField() - timefinish = models.BigIntegerField() - status = models.SmallIntegerField() - clickreportid = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_hotpot_attempts' - - -class MdlHotpotCache(models.Model): - id = models.BigIntegerField(primary_key=True) - hotpotid = models.BigIntegerField() - slasharguments = models.CharField(max_length=1) - hotpot_enableobfuscate = models.CharField(max_length=1) - hotpot_enableswf = models.CharField(max_length=1) - name = models.CharField(max_length=255) - sourcefile = models.CharField(max_length=255) - sourcetype = models.CharField(max_length=255) - sourcelocation = models.SmallIntegerField() - sourcelastmodified = models.CharField(max_length=255) - sourceetag = models.CharField(max_length=255) - configfile = models.CharField(max_length=255) - configlocation = models.SmallIntegerField() - configlastmodified = models.CharField(max_length=255) - configetag = models.CharField(max_length=255) - navigation = models.SmallIntegerField() - title = models.IntegerField() - stopbutton = models.SmallIntegerField() - stoptext = models.CharField(max_length=255) - usefilters = models.SmallIntegerField() - useglossary = models.SmallIntegerField() - usemediafilter = models.CharField(max_length=255) - studentfeedback = models.SmallIntegerField() - studentfeedbackurl = models.CharField(max_length=255) - timelimit = models.BigIntegerField() - delay3 = models.BigIntegerField() - clickreporting = models.SmallIntegerField() - content = models.TextField() - timemodified = models.BigIntegerField() - md5key = models.CharField(max_length=32) - sourcerepositoryid = models.BigIntegerField() - configrepositoryid = models.BigIntegerField() - hotpot_bodystyles = models.CharField(max_length=8) - allowpaste = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_hotpot_cache' - - -class MdlHotpotDetails(models.Model): - id = models.BigIntegerField(primary_key=True) - attemptid = models.BigIntegerField() - details = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_hotpot_details' - - -class MdlHotpotQuestions(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.TextField() - type = models.SmallIntegerField() - text = models.BigIntegerField() - hotpotid = models.BigIntegerField() - md5key = models.CharField(max_length=32) - - class Meta: - managed = False - db_table = 'mdl_hotpot_questions' - - -class MdlHotpotResponses(models.Model): - id = models.BigIntegerField(primary_key=True) - attemptid = models.BigIntegerField() - questionid = models.BigIntegerField() - score = models.IntegerField() - weighting = models.IntegerField() - correct = models.CharField(max_length=255) - wrong = models.CharField(max_length=255) - ignored = models.CharField(max_length=255) - hints = models.IntegerField() - clues = models.IntegerField() - checks = models.IntegerField() - - class Meta: - managed = False - db_table = 'mdl_hotpot_responses' - - -class MdlHotpotStrings(models.Model): - id = models.BigIntegerField(primary_key=True) - string = models.TextField() - md5key = models.CharField(max_length=32) - - class Meta: - managed = False - db_table = 'mdl_hotpot_strings' - - -class MdlImscp(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - revision = models.BigIntegerField() - keepold = models.BigIntegerField() - structure = models.TextField(blank=True) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_imscp' - - -class MdlJournal(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - introformat = models.SmallIntegerField() - days = models.IntegerField() - grade = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_journal' - - -class MdlJournalEntries(models.Model): - id = models.BigIntegerField(primary_key=True) - journal = models.BigIntegerField() - userid = models.BigIntegerField() - modified = models.BigIntegerField() - text = models.TextField() - format = models.SmallIntegerField() - rating = models.BigIntegerField(blank=True, null=True) - entrycomment = models.TextField(blank=True) - teacher = models.BigIntegerField() - timemarked = models.BigIntegerField() - mailed = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_journal_entries' - - -class MdlLabel(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - timemodified = models.BigIntegerField() - introformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_label' - - -class MdlLesson(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - practice = models.SmallIntegerField() - modattempts = models.SmallIntegerField() - usepassword = models.SmallIntegerField() - password = models.CharField(max_length=32) - dependency = models.BigIntegerField() - conditions = models.TextField() - grade = models.BigIntegerField() - custom = models.SmallIntegerField() - ongoing = models.SmallIntegerField() - usemaxgrade = models.SmallIntegerField() - maxanswers = models.SmallIntegerField() - maxattempts = models.SmallIntegerField() - review = models.SmallIntegerField() - nextpagedefault = models.SmallIntegerField() - feedback = models.SmallIntegerField() - minquestions = models.SmallIntegerField() - maxpages = models.SmallIntegerField() - timed = models.SmallIntegerField() - maxtime = models.BigIntegerField() - retake = models.SmallIntegerField() - activitylink = models.BigIntegerField() - mediafile = models.CharField(max_length=255) - mediaheight = models.BigIntegerField() - mediawidth = models.BigIntegerField() - mediaclose = models.SmallIntegerField() - slideshow = models.SmallIntegerField() - width = models.BigIntegerField() - height = models.BigIntegerField() - bgcolor = models.CharField(max_length=7) - displayleft = models.SmallIntegerField() - displayleftif = models.SmallIntegerField() - progressbar = models.SmallIntegerField() - highscores = models.SmallIntegerField() - maxhighscores = models.BigIntegerField() - available = models.BigIntegerField() - deadline = models.BigIntegerField() - timemodified = models.BigIntegerField() - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson' - - -class MdlLessonAnswers(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - pageid = models.BigIntegerField() - jumpto = models.BigIntegerField() - grade = models.SmallIntegerField() - score = models.BigIntegerField() - flags = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - answer = models.TextField(blank=True) - response = models.TextField(blank=True) - answerformat = models.SmallIntegerField() - responseformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson_answers' - - -class MdlLessonAttempts(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - pageid = models.BigIntegerField() - userid = models.BigIntegerField() - answerid = models.BigIntegerField() - retry = models.SmallIntegerField() - correct = models.BigIntegerField() - useranswer = models.TextField(blank=True) - timeseen = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson_attempts' - - -class MdlLessonBranch(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - userid = models.BigIntegerField() - pageid = models.BigIntegerField() - retry = models.BigIntegerField() - flag = models.SmallIntegerField() - timeseen = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson_branch' - - -class MdlLessonGrades(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - userid = models.BigIntegerField() - grade = models.FloatField() - late = models.SmallIntegerField() - completed = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson_grades' - - -class MdlLessonHighScores(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - userid = models.BigIntegerField() - gradeid = models.BigIntegerField() - nickname = models.CharField(max_length=5) - - class Meta: - managed = False - db_table = 'mdl_lesson_high_scores' - - -class MdlLessonPages(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - prevpageid = models.BigIntegerField() - nextpageid = models.BigIntegerField() - qtype = models.SmallIntegerField() - qoption = models.SmallIntegerField() - layout = models.SmallIntegerField() - display = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - title = models.CharField(max_length=255) - contents = models.TextField() - contentsformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson_pages' - - -class MdlLessonTimer(models.Model): - id = models.BigIntegerField(primary_key=True) - lessonid = models.BigIntegerField() - userid = models.BigIntegerField() - starttime = models.BigIntegerField() - lessontime = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lesson_timer' - - -class MdlLicense(models.Model): - id = models.BigIntegerField(primary_key=True) - shortname = models.CharField(max_length=255, blank=True) - fullname = models.TextField(blank=True) - source = models.CharField(max_length=255, blank=True) - enabled = models.SmallIntegerField() - version = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_license' - - -class MdlLockDb(models.Model): - id = models.BigIntegerField(primary_key=True) - resourcekey = models.CharField(unique=True, max_length=255) - expires = models.BigIntegerField(blank=True, null=True) - owner = models.CharField(max_length=36, blank=True) - - class Meta: - managed = False - db_table = 'mdl_lock_db' - - -class MdlLog(models.Model): - id = models.BigIntegerField(primary_key=True) - time = models.BigIntegerField() - userid = models.BigIntegerField() - ip = models.CharField(max_length=45) - course = models.BigIntegerField() - module = models.CharField(max_length=20) - cmid = models.BigIntegerField() - action = models.CharField(max_length=40) - url = models.CharField(max_length=100) - info = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_log' - - -class MdlLogDisplay(models.Model): - id = models.BigIntegerField(primary_key=True) - module = models.CharField(max_length=20) - action = models.CharField(max_length=40) - mtable = models.CharField(max_length=30) - field = models.CharField(max_length=200) - component = models.CharField(max_length=100) - - class Meta: - managed = False - db_table = 'mdl_log_display' - - -class MdlLogQueries(models.Model): - id = models.BigIntegerField(primary_key=True) - qtype = models.IntegerField() - sqltext = models.TextField() - sqlparams = models.TextField(blank=True) - error = models.IntegerField() - info = models.TextField(blank=True) - backtrace = models.TextField(blank=True) - exectime = models.DecimalField(max_digits=10, decimal_places=5) - timelogged = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_log_queries' - - -class MdlLogstoreStandardLog(models.Model): - id = models.BigIntegerField(primary_key=True) - eventname = models.CharField(max_length=255) - component = models.CharField(max_length=100) - action = models.CharField(max_length=100) - target = models.CharField(max_length=100) - objecttable = models.CharField(max_length=50, blank=True) - objectid = models.BigIntegerField(blank=True, null=True) - crud = models.CharField(max_length=1) - edulevel = models.SmallIntegerField() - contextid = models.BigIntegerField() - contextlevel = models.BigIntegerField() - contextinstanceid = models.BigIntegerField() - userid = models.BigIntegerField() - courseid = models.BigIntegerField(blank=True, null=True) - relateduserid = models.BigIntegerField(blank=True, null=True) - anonymous = models.SmallIntegerField() - other = models.TextField(blank=True) - timecreated = models.BigIntegerField() - origin = models.CharField(max_length=10, blank=True) - ip = models.CharField(max_length=45, blank=True) - realuserid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_logstore_standard_log' - - -class MdlLti(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - typeid = models.BigIntegerField(blank=True, null=True) - toolurl = models.TextField() - securetoolurl = models.TextField(blank=True) - instructorchoicesendname = models.SmallIntegerField(blank=True, null=True) - instructorchoicesendemailaddr = models.SmallIntegerField(blank=True, null=True) - instructorchoiceallowroster = models.SmallIntegerField(blank=True, null=True) - instructorchoiceallowsetting = models.SmallIntegerField(blank=True, null=True) - instructorcustomparameters = models.CharField(max_length=255, blank=True) - instructorchoiceacceptgrades = models.SmallIntegerField(blank=True, null=True) - grade = models.BigIntegerField() - launchcontainer = models.SmallIntegerField() - resourcekey = models.CharField(max_length=255, blank=True) - password = models.CharField(max_length=255, blank=True) - debuglaunch = models.SmallIntegerField() - showtitlelaunch = models.SmallIntegerField() - showdescriptionlaunch = models.SmallIntegerField() - servicesalt = models.CharField(max_length=40, blank=True) - icon = models.TextField(blank=True) - secureicon = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_lti' - - -class MdlLtiSubmission(models.Model): - id = models.BigIntegerField(primary_key=True) - ltiid = models.BigIntegerField() - userid = models.BigIntegerField() - datesubmitted = models.BigIntegerField() - dateupdated = models.BigIntegerField() - gradepercent = models.DecimalField(max_digits=10, decimal_places=5) - originalgrade = models.DecimalField(max_digits=10, decimal_places=5) - launchid = models.BigIntegerField() - state = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lti_submission' - - -class MdlLtiToolProxies(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - regurl = models.TextField(blank=True) - state = models.SmallIntegerField() - guid = models.CharField(unique=True, max_length=255, blank=True) - secret = models.CharField(max_length=255, blank=True) - vendorcode = models.CharField(max_length=255, blank=True) - capabilityoffered = models.TextField() - serviceoffered = models.TextField() - toolproxy = models.TextField(blank=True) - createdby = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lti_tool_proxies' - - -class MdlLtiToolSettings(models.Model): - id = models.BigIntegerField(primary_key=True) - toolproxyid = models.BigIntegerField() - course = models.BigIntegerField(blank=True, null=True) - coursemoduleid = models.BigIntegerField(blank=True, null=True) - settings = models.TextField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_lti_tool_settings' - - -class MdlLtiTypes(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - baseurl = models.TextField() - tooldomain = models.CharField(max_length=255) - state = models.SmallIntegerField() - course = models.BigIntegerField() - coursevisible = models.SmallIntegerField() - createdby = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - toolproxyid = models.BigIntegerField(blank=True, null=True) - enabledcapability = models.TextField(blank=True) - parameter = models.TextField(blank=True) - icon = models.TextField(blank=True) - secureicon = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_lti_types' - - -class MdlLtiTypesConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - typeid = models.BigIntegerField() - name = models.CharField(max_length=100) - value = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_lti_types_config' - - -class MdlMessage(models.Model): - id = models.BigIntegerField(primary_key=True) - useridfrom = models.BigIntegerField() - useridto = models.BigIntegerField() - fullmessage = models.TextField() - fullmessageformat = models.SmallIntegerField() - timecreated = models.BigIntegerField() - subject = models.TextField(blank=True) - fullmessagehtml = models.TextField(blank=True) - smallmessage = models.TextField(blank=True) - notification = models.SmallIntegerField(blank=True, null=True) - contexturl = models.TextField(blank=True) - contexturlname = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_message' - - -class MdlMessageAirnotifierDevices(models.Model): - id = models.BigIntegerField(primary_key=True) - userdeviceid = models.BigIntegerField(unique=True) - enable = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_message_airnotifier_devices' - - -class MdlMessageContacts(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - contactid = models.BigIntegerField() - blocked = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_message_contacts' - - -class MdlMessageProcessors(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=166) - enabled = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_message_processors' - - -class MdlMessageProviders(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=100) - component = models.CharField(max_length=200) - capability = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_message_providers' - - -class MdlMessageRead(models.Model): - id = models.BigIntegerField(primary_key=True) - useridfrom = models.BigIntegerField() - useridto = models.BigIntegerField() - fullmessage = models.TextField() - fullmessageformat = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timeread = models.BigIntegerField() - subject = models.TextField(blank=True) - fullmessagehtml = models.TextField(blank=True) - smallmessage = models.TextField(blank=True) - notification = models.SmallIntegerField(blank=True, null=True) - contexturl = models.TextField(blank=True) - contexturlname = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_message_read' - - -class MdlMessageWorking(models.Model): - id = models.BigIntegerField(primary_key=True) - unreadmessageid = models.BigIntegerField() - processorid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_message_working' - - -class MdlMessageinboundDatakeys(models.Model): - id = models.BigIntegerField(primary_key=True) - handler = models.BigIntegerField() - datavalue = models.BigIntegerField() - datakey = models.CharField(max_length=64, blank=True) - timecreated = models.BigIntegerField() - expires = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_messageinbound_datakeys' - - -class MdlMessageinboundHandlers(models.Model): - id = models.BigIntegerField(primary_key=True) - component = models.CharField(max_length=100) - classname = models.CharField(unique=True, max_length=255) - defaultexpiration = models.BigIntegerField() - validateaddress = models.SmallIntegerField() - enabled = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_messageinbound_handlers' - - -class MdlMessageinboundMessagelist(models.Model): - id = models.BigIntegerField(primary_key=True) - messageid = models.TextField() - userid = models.BigIntegerField() - address = models.TextField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_messageinbound_messagelist' - - -class MdlMnetApplication(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=50) - display_name = models.CharField(max_length=50) - xmlrpc_server_url = models.CharField(max_length=255) - sso_land_url = models.CharField(max_length=255) - sso_jump_url = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_mnet_application' - - -class MdlMnetHost(models.Model): - id = models.BigIntegerField(primary_key=True) - deleted = models.SmallIntegerField() - wwwroot = models.CharField(max_length=255) - ip_address = models.CharField(max_length=45) - name = models.CharField(max_length=80) - public_key = models.TextField() - public_key_expires = models.BigIntegerField() - transport = models.SmallIntegerField() - last_connect_time = models.BigIntegerField() - last_log_id = models.BigIntegerField() - applicationid = models.BigIntegerField() - force_theme = models.SmallIntegerField() - theme = models.CharField(max_length=100, blank=True) - portno = models.IntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_host' - - -class MdlMnetHost2Service(models.Model): - id = models.BigIntegerField(primary_key=True) - hostid = models.BigIntegerField() - serviceid = models.BigIntegerField() - publish = models.SmallIntegerField() - subscribe = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_host2service' - - -class MdlMnetLog(models.Model): - id = models.BigIntegerField(primary_key=True) - hostid = models.BigIntegerField() - remoteid = models.BigIntegerField() - time = models.BigIntegerField() - userid = models.BigIntegerField() - ip = models.CharField(max_length=45) - course = models.BigIntegerField() - coursename = models.CharField(max_length=40) - module = models.CharField(max_length=20) - cmid = models.BigIntegerField() - action = models.CharField(max_length=40) - url = models.CharField(max_length=100) - info = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_mnet_log' - - -class MdlMnetRemoteRpc(models.Model): - id = models.BigIntegerField(primary_key=True) - functionname = models.CharField(max_length=40) - xmlrpcpath = models.CharField(max_length=80) - plugintype = models.CharField(max_length=20) - pluginname = models.CharField(max_length=20) - enabled = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_remote_rpc' - - -class MdlMnetRemoteService2Rpc(models.Model): - id = models.BigIntegerField(primary_key=True) - serviceid = models.BigIntegerField() - rpcid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_remote_service2rpc' - - -class MdlMnetRpc(models.Model): - id = models.BigIntegerField(primary_key=True) - functionname = models.CharField(max_length=40) - xmlrpcpath = models.CharField(max_length=80) - plugintype = models.CharField(max_length=20) - pluginname = models.CharField(max_length=20) - enabled = models.SmallIntegerField() - help = models.TextField() - profile = models.TextField() - filename = models.CharField(max_length=100) - classname = models.CharField(max_length=150, blank=True) - static = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_mnet_rpc' - - -class MdlMnetService(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=40) - description = models.CharField(max_length=40) - apiversion = models.CharField(max_length=10) - offer = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_service' - - -class MdlMnetService2Rpc(models.Model): - id = models.BigIntegerField(primary_key=True) - serviceid = models.BigIntegerField() - rpcid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_service2rpc' - - -class MdlMnetSession(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - username = models.CharField(max_length=100) - token = models.CharField(unique=True, max_length=40) - mnethostid = models.BigIntegerField() - useragent = models.CharField(max_length=40) - confirm_timeout = models.BigIntegerField() - session_id = models.CharField(max_length=40) - expires = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_mnet_session' - - -class MdlMnetSsoAccessControl(models.Model): - id = models.BigIntegerField(primary_key=True) - username = models.CharField(max_length=100) - mnet_host_id = models.BigIntegerField() - accessctrl = models.CharField(max_length=20) - - class Meta: - managed = False - db_table = 'mdl_mnet_sso_access_control' - - -class MdlMnetserviceEnrolCourses(models.Model): - id = models.BigIntegerField(primary_key=True) - hostid = models.BigIntegerField() - remoteid = models.BigIntegerField() - categoryid = models.BigIntegerField() - categoryname = models.CharField(max_length=255) - sortorder = models.BigIntegerField() - fullname = models.CharField(max_length=254) - shortname = models.CharField(max_length=100) - idnumber = models.CharField(max_length=100) - summary = models.TextField() - summaryformat = models.SmallIntegerField(blank=True, null=True) - startdate = models.BigIntegerField() - roleid = models.BigIntegerField() - rolename = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_mnetservice_enrol_courses' - - -class MdlMnetserviceEnrolEnrolments(models.Model): - id = models.BigIntegerField(primary_key=True) - hostid = models.BigIntegerField() - userid = models.BigIntegerField() - remotecourseid = models.BigIntegerField() - rolename = models.CharField(max_length=255) - enroltime = models.BigIntegerField() - enroltype = models.CharField(max_length=20) - - class Meta: - managed = False - db_table = 'mdl_mnetservice_enrol_enrolments' - - -class MdlModules(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=20) - cron = models.BigIntegerField() - lastcron = models.BigIntegerField() - search = models.CharField(max_length=255) - visible = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_modules' - - -class MdlMyPages(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField(blank=True, null=True) - name = models.CharField(max_length=200) - private = models.SmallIntegerField() - sortorder = models.IntegerField() - - class Meta: - managed = False - db_table = 'mdl_my_pages' - - -class MdlPage(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - content = models.TextField(blank=True) - contentformat = models.SmallIntegerField() - legacyfiles = models.SmallIntegerField() - legacyfileslast = models.BigIntegerField(blank=True, null=True) - display = models.SmallIntegerField() - displayoptions = models.TextField(blank=True) - revision = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_page' - - -class MdlPortfolioInstance(models.Model): - id = models.BigIntegerField(primary_key=True) - plugin = models.CharField(max_length=50) - name = models.CharField(max_length=255) - visible = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_portfolio_instance' - - -class MdlPortfolioInstanceConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - instance = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_portfolio_instance_config' - - -class MdlPortfolioInstanceUser(models.Model): - id = models.BigIntegerField(primary_key=True) - instance = models.BigIntegerField() - userid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_portfolio_instance_user' - - -class MdlPortfolioLog(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - time = models.BigIntegerField() - portfolio = models.BigIntegerField() - caller_class = models.CharField(max_length=150) - caller_file = models.CharField(max_length=255) - caller_sha1 = models.CharField(max_length=255) - tempdataid = models.BigIntegerField() - returnurl = models.CharField(max_length=255) - continueurl = models.CharField(max_length=255) - caller_component = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_portfolio_log' - - -class MdlPortfolioMaharaQueue(models.Model): - id = models.BigIntegerField(primary_key=True) - transferid = models.BigIntegerField() - token = models.CharField(max_length=50) - - class Meta: - managed = False - db_table = 'mdl_portfolio_mahara_queue' - - -class MdlPortfolioTempdata(models.Model): - id = models.BigIntegerField(primary_key=True) - data = models.TextField(blank=True) - expirytime = models.BigIntegerField() - userid = models.BigIntegerField() - instance = models.BigIntegerField(blank=True, null=True) - queued = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_portfolio_tempdata' - - -class MdlPost(models.Model): - id = models.BigIntegerField(primary_key=True) - module = models.CharField(max_length=20) - userid = models.BigIntegerField() - courseid = models.BigIntegerField() - groupid = models.BigIntegerField() - moduleid = models.BigIntegerField() - coursemoduleid = models.BigIntegerField() - subject = models.CharField(max_length=128) - summary = models.TextField(blank=True) - content = models.TextField(blank=True) - uniquehash = models.CharField(max_length=255) - rating = models.BigIntegerField() - format = models.BigIntegerField() - attachment = models.CharField(max_length=100, blank=True) - publishstate = models.CharField(max_length=20) - lastmodified = models.BigIntegerField() - created = models.BigIntegerField() - usermodified = models.BigIntegerField(blank=True, null=True) - summaryformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_post' - - -class MdlProfiling(models.Model): - id = models.BigIntegerField(primary_key=True) - runid = models.CharField(unique=True, max_length=32) - url = models.CharField(max_length=255) - data = models.TextField() - totalexecutiontime = models.BigIntegerField() - totalcputime = models.BigIntegerField() - totalcalls = models.BigIntegerField() - totalmemory = models.BigIntegerField() - runreference = models.SmallIntegerField() - runcomment = models.CharField(max_length=255) - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_profiling' - - -class MdlQtypeEssayOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField(unique=True) - responseformat = models.CharField(max_length=16) - responsefieldlines = models.SmallIntegerField() - attachments = models.SmallIntegerField() - graderinfo = models.TextField(blank=True) - graderinfoformat = models.SmallIntegerField() - responsetemplate = models.TextField(blank=True) - responsetemplateformat = models.SmallIntegerField() - responserequired = models.SmallIntegerField() - attachmentsrequired = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_qtype_essay_options' - - -class MdlQtypeMatchOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField(unique=True) - shuffleanswers = models.SmallIntegerField() - correctfeedback = models.TextField() - correctfeedbackformat = models.SmallIntegerField() - partiallycorrectfeedback = models.TextField() - partiallycorrectfeedbackformat = models.SmallIntegerField() - incorrectfeedback = models.TextField() - incorrectfeedbackformat = models.SmallIntegerField() - shownumcorrect = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_qtype_match_options' - - -class MdlQtypeMatchSubquestions(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField() - questiontext = models.TextField() - answertext = models.CharField(max_length=255) - questiontextformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_qtype_match_subquestions' - - -class MdlQtypeMultichoiceOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField(unique=True) - layout = models.SmallIntegerField() - single = models.SmallIntegerField() - shuffleanswers = models.SmallIntegerField() - correctfeedback = models.TextField() - partiallycorrectfeedback = models.TextField() - incorrectfeedback = models.TextField() - answernumbering = models.CharField(max_length=10) - correctfeedbackformat = models.SmallIntegerField() - partiallycorrectfeedbackformat = models.SmallIntegerField() - incorrectfeedbackformat = models.SmallIntegerField() - shownumcorrect = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_qtype_multichoice_options' - - -class MdlQtypeRandomsamatchOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField(unique=True) - choose = models.BigIntegerField() - subcats = models.SmallIntegerField() - correctfeedback = models.TextField() - correctfeedbackformat = models.SmallIntegerField() - partiallycorrectfeedback = models.TextField() - partiallycorrectfeedbackformat = models.SmallIntegerField() - incorrectfeedback = models.TextField() - incorrectfeedbackformat = models.SmallIntegerField() - shownumcorrect = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_qtype_randomsamatch_options' - - -class MdlQtypeShortanswerOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField(unique=True) - usecase = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_qtype_shortanswer_options' - - -class MdlQuestion(models.Model): - id = models.BigIntegerField(primary_key=True) - category = models.BigIntegerField() - parent = models.BigIntegerField() - name = models.CharField(max_length=255) - questiontext = models.TextField() - questiontextformat = models.SmallIntegerField() - generalfeedback = models.TextField() - defaultmark = models.DecimalField(max_digits=12, decimal_places=7) - penalty = models.DecimalField(max_digits=12, decimal_places=7) - qtype = models.CharField(max_length=20) - length = models.BigIntegerField() - stamp = models.CharField(max_length=255) - version = models.CharField(max_length=255) - hidden = models.SmallIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - createdby = models.BigIntegerField(blank=True, null=True) - modifiedby = models.BigIntegerField(blank=True, null=True) - generalfeedbackformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question' - - -class MdlQuestionAnswers(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - answer = models.TextField() - fraction = models.DecimalField(max_digits=12, decimal_places=7) - feedback = models.TextField() - answerformat = models.SmallIntegerField() - feedbackformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_answers' - - -class MdlQuestionAttemptStepData(models.Model): - id = models.BigIntegerField(primary_key=True) - attemptstepid = models.BigIntegerField() - name = models.CharField(max_length=32) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_question_attempt_step_data' - - -class MdlQuestionAttemptSteps(models.Model): - id = models.BigIntegerField(primary_key=True) - questionattemptid = models.BigIntegerField() - sequencenumber = models.BigIntegerField() - state = models.CharField(max_length=13) - fraction = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - timecreated = models.BigIntegerField() - userid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_question_attempt_steps' - - -class MdlQuestionAttempts(models.Model): - id = models.BigIntegerField(primary_key=True) - questionusageid = models.BigIntegerField() - slot = models.BigIntegerField() - behaviour = models.CharField(max_length=32) - questionid = models.BigIntegerField() - maxmark = models.DecimalField(max_digits=12, decimal_places=7) - minfraction = models.DecimalField(max_digits=12, decimal_places=7) - flagged = models.SmallIntegerField() - questionsummary = models.TextField(blank=True) - rightanswer = models.TextField(blank=True) - responsesummary = models.TextField(blank=True) - timemodified = models.BigIntegerField() - variant = models.BigIntegerField() - maxfraction = models.DecimalField(max_digits=12, decimal_places=7) - - class Meta: - managed = False - db_table = 'mdl_question_attempts' - - -class MdlQuestionCalculated(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - answer = models.BigIntegerField() - tolerance = models.CharField(max_length=20) - tolerancetype = models.BigIntegerField() - correctanswerlength = models.BigIntegerField() - correctanswerformat = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_calculated' - - -class MdlQuestionCalculatedOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - synchronize = models.SmallIntegerField() - single = models.SmallIntegerField() - shuffleanswers = models.SmallIntegerField() - correctfeedback = models.TextField(blank=True) - partiallycorrectfeedback = models.TextField(blank=True) - incorrectfeedback = models.TextField(blank=True) - answernumbering = models.CharField(max_length=10) - correctfeedbackformat = models.SmallIntegerField() - partiallycorrectfeedbackformat = models.SmallIntegerField() - incorrectfeedbackformat = models.SmallIntegerField() - shownumcorrect = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_calculated_options' - - -class MdlQuestionCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - info = models.TextField() - stamp = models.CharField(max_length=255) - parent = models.BigIntegerField() - sortorder = models.BigIntegerField() - contextid = models.BigIntegerField() - infoformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_categories' - - -class MdlQuestionDatasetDefinitions(models.Model): - id = models.BigIntegerField(primary_key=True) - category = models.BigIntegerField() - name = models.CharField(max_length=255) - type = models.BigIntegerField() - options = models.CharField(max_length=255) - itemcount = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_dataset_definitions' - - -class MdlQuestionDatasetItems(models.Model): - id = models.BigIntegerField(primary_key=True) - definition = models.BigIntegerField() - itemnumber = models.BigIntegerField() - value = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_question_dataset_items' - - -class MdlQuestionDatasets(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - datasetdefinition = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_datasets' - - -class MdlQuestionHints(models.Model): - id = models.BigIntegerField(primary_key=True) - questionid = models.BigIntegerField() - hint = models.TextField() - hintformat = models.SmallIntegerField() - shownumcorrect = models.SmallIntegerField(blank=True, null=True) - clearwrong = models.SmallIntegerField(blank=True, null=True) - options = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_question_hints' - - -class MdlQuestionMultianswer(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - sequence = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_question_multianswer' - - -class MdlQuestionNumerical(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - answer = models.BigIntegerField() - tolerance = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_question_numerical' - - -class MdlQuestionNumericalOptions(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - showunits = models.SmallIntegerField() - unitsleft = models.SmallIntegerField() - unitgradingtype = models.SmallIntegerField() - unitpenalty = models.DecimalField(max_digits=12, decimal_places=7) - - class Meta: - managed = False - db_table = 'mdl_question_numerical_options' - - -class MdlQuestionNumericalUnits(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - multiplier = models.DecimalField(max_digits=40, decimal_places=20) - unit = models.CharField(max_length=50) - - class Meta: - managed = False - db_table = 'mdl_question_numerical_units' - - -class MdlQuestionResponseAnalysis(models.Model): - id = models.BigIntegerField(primary_key=True) - hashcode = models.CharField(max_length=40) - timemodified = models.BigIntegerField() - questionid = models.BigIntegerField() - subqid = models.CharField(max_length=100) - aid = models.CharField(max_length=100, blank=True) - response = models.TextField(blank=True) - credit = models.DecimalField(max_digits=15, decimal_places=5) - variant = models.BigIntegerField(blank=True, null=True) - whichtries = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_question_response_analysis' - - -class MdlQuestionResponseCount(models.Model): - id = models.BigIntegerField(primary_key=True) - analysisid = models.BigIntegerField() - try_field = models.BigIntegerField(db_column='try') # Field renamed because it was a Python reserved word. - rcount = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_response_count' - - -class MdlQuestionStatistics(models.Model): - id = models.BigIntegerField(primary_key=True) - hashcode = models.CharField(max_length=40) - timemodified = models.BigIntegerField() - questionid = models.BigIntegerField() - slot = models.BigIntegerField(blank=True, null=True) - subquestion = models.SmallIntegerField() - s = models.BigIntegerField() - effectiveweight = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - negcovar = models.SmallIntegerField() - discriminationindex = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - discriminativeefficiency = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - sd = models.DecimalField(max_digits=15, decimal_places=10, blank=True, null=True) - facility = models.DecimalField(max_digits=15, decimal_places=10, blank=True, null=True) - subquestions = models.TextField(blank=True) - maxmark = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - positions = models.TextField(blank=True) - randomguessscore = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - variant = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_question_statistics' - - -class MdlQuestionTruefalse(models.Model): - id = models.BigIntegerField(primary_key=True) - question = models.BigIntegerField() - trueanswer = models.BigIntegerField() - falseanswer = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_question_truefalse' - - -class MdlQuestionUsages(models.Model): - id = models.BigIntegerField(primary_key=True) - component = models.CharField(max_length=255) - contextid = models.BigIntegerField() - preferredbehaviour = models.CharField(max_length=32) - - class Meta: - managed = False - db_table = 'mdl_question_usages' - - -class MdlQuiz(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - timeopen = models.BigIntegerField() - timeclose = models.BigIntegerField() - attempts = models.IntegerField() - attemptonlast = models.SmallIntegerField() - grademethod = models.SmallIntegerField() - decimalpoints = models.SmallIntegerField() - questionsperpage = models.BigIntegerField() - shufflequestions = models.SmallIntegerField() - shuffleanswers = models.SmallIntegerField() - sumgrades = models.DecimalField(max_digits=10, decimal_places=5) - grade = models.DecimalField(max_digits=10, decimal_places=5) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - password = models.CharField(max_length=255) - subnet = models.CharField(max_length=255) - delay1 = models.BigIntegerField() - delay2 = models.BigIntegerField() - timelimit = models.BigIntegerField() - showuserpicture = models.SmallIntegerField() - questiondecimalpoints = models.SmallIntegerField() - introformat = models.SmallIntegerField() - showblocks = models.SmallIntegerField() - preferredbehaviour = models.CharField(max_length=32) - reviewattempt = models.IntegerField() - reviewcorrectness = models.IntegerField() - reviewmarks = models.IntegerField() - reviewspecificfeedback = models.IntegerField() - reviewgeneralfeedback = models.IntegerField() - reviewrightanswer = models.IntegerField() - reviewoverallfeedback = models.IntegerField() - browsersecurity = models.CharField(max_length=32) - navmethod = models.CharField(max_length=16) - overduehandling = models.CharField(max_length=16) - graceperiod = models.BigIntegerField() - completionattemptsexhausted = models.SmallIntegerField(blank=True, null=True) - completionpass = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_quiz' - - -class MdlQuizAttempts(models.Model): - id = models.BigIntegerField(primary_key=True) - uniqueid = models.BigIntegerField(unique=True) - quiz = models.BigIntegerField() - userid = models.BigIntegerField() - attempt = models.IntegerField() - sumgrades = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - timestart = models.BigIntegerField() - timefinish = models.BigIntegerField() - timemodified = models.BigIntegerField() - layout = models.TextField() - preview = models.SmallIntegerField() - currentpage = models.BigIntegerField() - state = models.CharField(max_length=16) - timecheckstate = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_quiz_attempts' - - -class MdlQuizFeedback(models.Model): - id = models.BigIntegerField(primary_key=True) - quizid = models.BigIntegerField() - feedbacktext = models.TextField() - mingrade = models.DecimalField(max_digits=10, decimal_places=5) - maxgrade = models.DecimalField(max_digits=10, decimal_places=5) - feedbacktextformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_quiz_feedback' - - -class MdlQuizGrades(models.Model): - id = models.BigIntegerField(primary_key=True) - quiz = models.BigIntegerField() - userid = models.BigIntegerField() - grade = models.DecimalField(max_digits=10, decimal_places=5) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_quiz_grades' - - -class MdlQuizOverrides(models.Model): - id = models.BigIntegerField(primary_key=True) - quiz = models.BigIntegerField() - groupid = models.BigIntegerField(blank=True, null=True) - userid = models.BigIntegerField(blank=True, null=True) - timeopen = models.BigIntegerField(blank=True, null=True) - timeclose = models.BigIntegerField(blank=True, null=True) - timelimit = models.BigIntegerField(blank=True, null=True) - attempts = models.IntegerField(blank=True, null=True) - password = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_quiz_overrides' - - -class MdlQuizOverviewRegrades(models.Model): - id = models.BigIntegerField(primary_key=True) - questionusageid = models.BigIntegerField() - newfraction = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - oldfraction = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - regraded = models.SmallIntegerField() - timemodified = models.BigIntegerField() - slot = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_quiz_overview_regrades' - - -class MdlQuizReports(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=255, blank=True) - displayorder = models.BigIntegerField() - capability = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_quiz_reports' - - -class MdlQuizSlots(models.Model): - id = models.BigIntegerField(primary_key=True) - quizid = models.BigIntegerField() - questionid = models.BigIntegerField() - maxmark = models.DecimalField(max_digits=12, decimal_places=7) - slot = models.BigIntegerField() - page = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_quiz_slots' - - -class MdlQuizStatistics(models.Model): - id = models.BigIntegerField(primary_key=True) - hashcode = models.CharField(max_length=40) - whichattempts = models.SmallIntegerField() - timemodified = models.BigIntegerField() - firstattemptscount = models.BigIntegerField() - highestattemptscount = models.BigIntegerField() - lastattemptscount = models.BigIntegerField() - allattemptscount = models.BigIntegerField() - firstattemptsavg = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - highestattemptsavg = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - lastattemptsavg = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - allattemptsavg = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - median = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - standarddeviation = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - skewness = models.DecimalField(max_digits=15, decimal_places=10, blank=True, null=True) - kurtosis = models.DecimalField(max_digits=15, decimal_places=5, blank=True, null=True) - cic = models.DecimalField(max_digits=15, decimal_places=10, blank=True, null=True) - errorratio = models.DecimalField(max_digits=15, decimal_places=10, blank=True, null=True) - standarderror = models.DecimalField(max_digits=15, decimal_places=10, blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_quiz_statistics' - - -class MdlRating(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - itemid = models.BigIntegerField() - scaleid = models.BigIntegerField() - rating = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - component = models.CharField(max_length=100) - ratingarea = models.CharField(max_length=50) - - class Meta: - managed = False - db_table = 'mdl_rating' - - -class MdlRegistrationHubs(models.Model): - id = models.BigIntegerField(primary_key=True) - token = models.CharField(max_length=255) - hubname = models.CharField(max_length=255) - huburl = models.CharField(max_length=255) - confirmed = models.SmallIntegerField() - secret = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_registration_hubs' - - -class MdlRepository(models.Model): - id = models.BigIntegerField(primary_key=True) - type = models.CharField(max_length=255) - visible = models.SmallIntegerField(blank=True, null=True) - sortorder = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_repository' - - -class MdlRepositoryInstanceConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - instanceid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_repository_instance_config' - - -class MdlRepositoryInstances(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - typeid = models.BigIntegerField() - userid = models.BigIntegerField() - contextid = models.BigIntegerField() - username = models.CharField(max_length=255, blank=True) - password = models.CharField(max_length=255, blank=True) - timecreated = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - readonly = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_repository_instances' - - -class MdlResource(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - timemodified = models.BigIntegerField() - introformat = models.SmallIntegerField() - tobemigrated = models.SmallIntegerField() - legacyfiles = models.SmallIntegerField() - legacyfileslast = models.BigIntegerField(blank=True, null=True) - display = models.SmallIntegerField() - displayoptions = models.TextField(blank=True) - filterfiles = models.SmallIntegerField() - revision = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_resource' - - -class MdlResourceOld(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - type = models.CharField(max_length=30) - reference = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - alltext = models.TextField() - popup = models.TextField() - options = models.CharField(max_length=255) - timemodified = models.BigIntegerField() - oldid = models.BigIntegerField(unique=True) - cmid = models.BigIntegerField(blank=True, null=True) - newmodule = models.CharField(max_length=50, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - migrated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_resource_old' - - -class MdlRole(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - shortname = models.CharField(unique=True, max_length=100) - description = models.TextField() - sortorder = models.BigIntegerField(unique=True) - archetype = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_role' - - -class MdlRoleAllowAssign(models.Model): - id = models.BigIntegerField(primary_key=True) - roleid = models.BigIntegerField() - allowassign = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_allow_assign' - - -class MdlRoleAllowOverride(models.Model): - id = models.BigIntegerField(primary_key=True) - roleid = models.BigIntegerField() - allowoverride = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_allow_override' - - -class MdlRoleAllowSwitch(models.Model): - id = models.BigIntegerField(primary_key=True) - roleid = models.BigIntegerField() - allowswitch = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_allow_switch' - - -class MdlRoleAssignments(models.Model): - id = models.BigIntegerField(primary_key=True) - roleid = models.BigIntegerField() - contextid = models.BigIntegerField() - userid = models.BigIntegerField() - timemodified = models.BigIntegerField() - modifierid = models.BigIntegerField() - component = models.CharField(max_length=100) - sortorder = models.BigIntegerField() - itemid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_assignments' - - -class MdlRoleCapabilities(models.Model): - id = models.BigIntegerField(primary_key=True) - contextid = models.BigIntegerField() - roleid = models.BigIntegerField() - capability = models.CharField(max_length=255) - permission = models.BigIntegerField() - timemodified = models.BigIntegerField() - modifierid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_capabilities' - - -class MdlRoleContextLevels(models.Model): - id = models.BigIntegerField(primary_key=True) - roleid = models.BigIntegerField() - contextlevel = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_context_levels' - - -class MdlRoleNames(models.Model): - id = models.BigIntegerField(primary_key=True) - roleid = models.BigIntegerField() - contextid = models.BigIntegerField() - name = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_role_names' - - -class MdlRoleSortorder(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - roleid = models.BigIntegerField() - contextid = models.BigIntegerField() - sortoder = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_role_sortorder' - - -class MdlScale(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - userid = models.BigIntegerField() - name = models.CharField(max_length=255) - scale = models.TextField() - description = models.TextField() - timemodified = models.BigIntegerField() - descriptionformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_scale' - - -class MdlScaleHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - action = models.BigIntegerField() - oldid = models.BigIntegerField() - source = models.CharField(max_length=255, blank=True) - timemodified = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField() - userid = models.BigIntegerField() - name = models.CharField(max_length=255) - scale = models.TextField() - description = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_scale_history' - - -class MdlScorm(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - reference = models.CharField(max_length=255) - intro = models.TextField() - version = models.CharField(max_length=9) - maxgrade = models.FloatField() - grademethod = models.SmallIntegerField() - maxattempt = models.BigIntegerField() - updatefreq = models.SmallIntegerField() - md5hash = models.CharField(max_length=32) - launch = models.BigIntegerField() - skipview = models.SmallIntegerField() - hidebrowse = models.SmallIntegerField() - hidetoc = models.SmallIntegerField() - auto = models.SmallIntegerField() - popup = models.SmallIntegerField() - options = models.CharField(max_length=255) - width = models.BigIntegerField() - height = models.BigIntegerField() - timemodified = models.BigIntegerField() - whatgrade = models.BigIntegerField() - scormtype = models.CharField(max_length=50) - sha1hash = models.CharField(max_length=40, blank=True) - revision = models.BigIntegerField() - forcecompleted = models.SmallIntegerField() - forcenewattempt = models.SmallIntegerField() - lastattemptlock = models.SmallIntegerField() - displayattemptstatus = models.SmallIntegerField() - displaycoursestructure = models.SmallIntegerField() - timeopen = models.BigIntegerField() - timeclose = models.BigIntegerField() - introformat = models.SmallIntegerField() - completionstatusrequired = models.SmallIntegerField(blank=True, null=True) - completionscorerequired = models.SmallIntegerField(blank=True, null=True) - nav = models.SmallIntegerField() - navpositionleft = models.BigIntegerField(blank=True, null=True) - navpositiontop = models.BigIntegerField(blank=True, null=True) - displayactivityname = models.SmallIntegerField() - autocommit = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_scorm' - - -class MdlScormAiccSession(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - scormid = models.BigIntegerField() - hacpsession = models.CharField(max_length=255) - scoid = models.BigIntegerField(blank=True, null=True) - scormmode = models.CharField(max_length=50, blank=True) - scormstatus = models.CharField(max_length=255, blank=True) - attempt = models.BigIntegerField(blank=True, null=True) - lessonstatus = models.CharField(max_length=255, blank=True) - sessiontime = models.CharField(max_length=255, blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_scorm_aicc_session' - - -class MdlScormScoes(models.Model): - id = models.BigIntegerField(primary_key=True) - scorm = models.BigIntegerField() - manifest = models.CharField(max_length=255) - organization = models.CharField(max_length=255) - parent = models.CharField(max_length=255) - identifier = models.CharField(max_length=255) - launch = models.TextField() - scormtype = models.CharField(max_length=5) - title = models.CharField(max_length=255) - sortorder = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_scorm_scoes' - - -class MdlScormScoesData(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_scorm_scoes_data' - - -class MdlScormScoesTrack(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - scormid = models.BigIntegerField() - scoid = models.BigIntegerField() - attempt = models.BigIntegerField() - element = models.CharField(max_length=255) - value = models.TextField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_scorm_scoes_track' - - -class MdlScormSeqMapinfo(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - objectiveid = models.BigIntegerField() - targetobjectiveid = models.BigIntegerField() - readsatisfiedstatus = models.SmallIntegerField() - readnormalizedmeasure = models.SmallIntegerField() - writesatisfiedstatus = models.SmallIntegerField() - writenormalizedmeasure = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_scorm_seq_mapinfo' - - -class MdlScormSeqObjective(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - primaryobj = models.SmallIntegerField() - objectiveid = models.CharField(max_length=255) - satisfiedbymeasure = models.SmallIntegerField() - minnormalizedmeasure = models.FloatField() - - class Meta: - managed = False - db_table = 'mdl_scorm_seq_objective' - - -class MdlScormSeqRolluprule(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - childactivityset = models.CharField(max_length=15) - minimumcount = models.BigIntegerField() - minimumpercent = models.FloatField() - conditioncombination = models.CharField(max_length=3) - action = models.CharField(max_length=15) - - class Meta: - managed = False - db_table = 'mdl_scorm_seq_rolluprule' - - -class MdlScormSeqRolluprulecond(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - rollupruleid = models.BigIntegerField() - operator = models.CharField(max_length=5) - cond = models.CharField(max_length=25) - - class Meta: - managed = False - db_table = 'mdl_scorm_seq_rolluprulecond' - - -class MdlScormSeqRulecond(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - ruleconditionsid = models.BigIntegerField() - refrencedobjective = models.CharField(max_length=255) - measurethreshold = models.FloatField() - operator = models.CharField(max_length=5) - cond = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_scorm_seq_rulecond' - - -class MdlScormSeqRuleconds(models.Model): - id = models.BigIntegerField(primary_key=True) - scoid = models.BigIntegerField() - conditioncombination = models.CharField(max_length=3) - ruletype = models.SmallIntegerField() - action = models.CharField(max_length=25) - - class Meta: - managed = False - db_table = 'mdl_scorm_seq_ruleconds' - - -class MdlSessions(models.Model): - id = models.BigIntegerField(primary_key=True) - state = models.BigIntegerField() - sid = models.CharField(unique=True, max_length=128) - userid = models.BigIntegerField() - sessdata = models.TextField(blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - firstip = models.CharField(max_length=45, blank=True) - lastip = models.CharField(max_length=45, blank=True) - - class Meta: - managed = False - db_table = 'mdl_sessions' - - -class MdlStatsDaily(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - timeend = models.BigIntegerField() - roleid = models.BigIntegerField() - stattype = models.CharField(max_length=20) - stat1 = models.BigIntegerField() - stat2 = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_stats_daily' - - -class MdlStatsMonthly(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - timeend = models.BigIntegerField() - roleid = models.BigIntegerField() - stattype = models.CharField(max_length=20) - stat1 = models.BigIntegerField() - stat2 = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_stats_monthly' - - -class MdlStatsUserDaily(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - userid = models.BigIntegerField() - roleid = models.BigIntegerField() - timeend = models.BigIntegerField() - statsreads = models.BigIntegerField() - statswrites = models.BigIntegerField() - stattype = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_stats_user_daily' - - -class MdlStatsUserMonthly(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - userid = models.BigIntegerField() - roleid = models.BigIntegerField() - timeend = models.BigIntegerField() - statsreads = models.BigIntegerField() - statswrites = models.BigIntegerField() - stattype = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_stats_user_monthly' - - -class MdlStatsUserWeekly(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - userid = models.BigIntegerField() - roleid = models.BigIntegerField() - timeend = models.BigIntegerField() - statsreads = models.BigIntegerField() - statswrites = models.BigIntegerField() - stattype = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_stats_user_weekly' - - -class MdlStatsWeekly(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - timeend = models.BigIntegerField() - roleid = models.BigIntegerField() - stattype = models.CharField(max_length=20) - stat1 = models.BigIntegerField() - stat2 = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_stats_weekly' - - -class MdlSurvey(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - template = models.BigIntegerField() - days = models.IntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField() - questions = models.CharField(max_length=255) - introformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_survey' - - -class MdlSurveyAnalysis(models.Model): - id = models.BigIntegerField(primary_key=True) - survey = models.BigIntegerField() - userid = models.BigIntegerField() - notes = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_survey_analysis' - - -class MdlSurveyAnswers(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - survey = models.BigIntegerField() - question = models.BigIntegerField() - time = models.BigIntegerField() - answer1 = models.TextField() - answer2 = models.TextField() - - class Meta: - managed = False - db_table = 'mdl_survey_answers' - - -class MdlSurveyQuestions(models.Model): - id = models.BigIntegerField(primary_key=True) - text = models.CharField(max_length=255) - shorttext = models.CharField(max_length=30) - multi = models.CharField(max_length=100) - intro = models.CharField(max_length=50) - type = models.SmallIntegerField() - options = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_survey_questions' - - -class MdlTag(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(unique=True, max_length=255) - tagtype = models.CharField(max_length=255, blank=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField() - flag = models.SmallIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - rawname = models.CharField(max_length=255) - userid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tag' - - -class MdlTagCorrelation(models.Model): - id = models.BigIntegerField(primary_key=True) - correlatedtags = models.TextField() - tagid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tag_correlation' - - -class MdlTagInstance(models.Model): - id = models.BigIntegerField(primary_key=True) - itemtype = models.CharField(max_length=255) - timemodified = models.BigIntegerField() - tagid = models.BigIntegerField() - itemid = models.BigIntegerField() - ordering = models.BigIntegerField(blank=True, null=True) - tiuserid = models.BigIntegerField() - component = models.CharField(max_length=100, blank=True) - contextid = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tag_instance' - - -class MdlTaskAdhoc(models.Model): - id = models.BigIntegerField(primary_key=True) - component = models.CharField(max_length=255) - classname = models.CharField(max_length=255) - nextruntime = models.BigIntegerField() - faildelay = models.BigIntegerField(blank=True, null=True) - customdata = models.TextField(blank=True) - blocking = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_task_adhoc' - - -class MdlTaskScheduled(models.Model): - id = models.BigIntegerField(primary_key=True) - component = models.CharField(max_length=255) - classname = models.CharField(unique=True, max_length=255) - lastruntime = models.BigIntegerField(blank=True, null=True) - nextruntime = models.BigIntegerField(blank=True, null=True) - blocking = models.SmallIntegerField() - minute = models.CharField(max_length=25) - hour = models.CharField(max_length=25) - day = models.CharField(max_length=25) - month = models.CharField(max_length=25) - dayofweek = models.CharField(max_length=25) - faildelay = models.BigIntegerField(blank=True, null=True) - customised = models.SmallIntegerField() - disabled = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_task_scheduled' - - -class MdlTimezone(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=100) - year = models.BigIntegerField() - tzrule = models.CharField(max_length=20) - gmtoff = models.BigIntegerField() - dstoff = models.BigIntegerField() - dst_month = models.SmallIntegerField() - dst_startday = models.SmallIntegerField() - dst_weekday = models.SmallIntegerField() - dst_skipweeks = models.SmallIntegerField() - dst_time = models.CharField(max_length=6) - std_month = models.SmallIntegerField() - std_startday = models.SmallIntegerField() - std_weekday = models.SmallIntegerField() - std_skipweeks = models.SmallIntegerField() - std_time = models.CharField(max_length=6) - - class Meta: - managed = False - db_table = 'mdl_timezone' - - -class MdlToolCustomlang(models.Model): - id = models.BigIntegerField(primary_key=True) - lang = models.CharField(max_length=20) - componentid = models.BigIntegerField() - stringid = models.CharField(max_length=255) - original = models.TextField() - master = models.TextField(blank=True) - local = models.TextField(blank=True) - timemodified = models.BigIntegerField() - timecustomized = models.BigIntegerField(blank=True, null=True) - outdated = models.SmallIntegerField(blank=True, null=True) - modified = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_tool_customlang' - - -class MdlToolCustomlangComponents(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - version = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_tool_customlang_components' - - -class MdlToolMonitorEvents(models.Model): - id = models.BigIntegerField(primary_key=True) - eventname = models.CharField(max_length=254) - contextid = models.BigIntegerField() - contextlevel = models.BigIntegerField() - contextinstanceid = models.BigIntegerField() - link = models.CharField(max_length=254) - courseid = models.BigIntegerField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tool_monitor_events' - - -class MdlToolMonitorHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - sid = models.BigIntegerField() - userid = models.BigIntegerField() - timesent = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tool_monitor_history' - - -class MdlToolMonitorRules(models.Model): - id = models.BigIntegerField(primary_key=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField() - name = models.CharField(max_length=254) - userid = models.BigIntegerField() - courseid = models.BigIntegerField() - plugin = models.CharField(max_length=254) - eventname = models.CharField(max_length=254) - template = models.TextField() - templateformat = models.SmallIntegerField() - frequency = models.SmallIntegerField() - timewindow = models.IntegerField() - timemodified = models.BigIntegerField() - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tool_monitor_rules' - - -class MdlToolMonitorSubscriptions(models.Model): - id = models.BigIntegerField(primary_key=True) - courseid = models.BigIntegerField() - ruleid = models.BigIntegerField() - cmid = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - lastnotificationsent = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_tool_monitor_subscriptions' - - -class MdlUnittestCourseModules(models.Model): - id = models.BigIntegerField(primary_key=True) - groupmembersonly = models.SmallIntegerField() - groupingid = models.BigIntegerField() - groupmode = models.SmallIntegerField() - visibleold = models.SmallIntegerField() - visible = models.SmallIntegerField() - indent = models.IntegerField() - score = models.SmallIntegerField() - added = models.BigIntegerField() - idnumber = models.CharField(max_length=100, blank=True) - section = models.BigIntegerField() - instance = models.BigIntegerField() - module = models.BigIntegerField() - course = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_course_modules' - - -class MdlUnittestGradeCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - timemodified = models.BigIntegerField() - timecreated = models.BigIntegerField() - aggregatesubcats = models.SmallIntegerField() - aggregateoutcomes = models.SmallIntegerField() - aggregateonlygraded = models.SmallIntegerField() - droplow = models.BigIntegerField() - keephigh = models.BigIntegerField() - aggregation = models.BigIntegerField() - fullname = models.CharField(max_length=255) - path = models.CharField(max_length=255, blank=True) - depth = models.BigIntegerField() - parent = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_categories' - - -class MdlUnittestGradeCategoriesHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - aggregatesubcats = models.SmallIntegerField() - aggregateoutcomes = models.SmallIntegerField() - aggregateonlygraded = models.SmallIntegerField() - droplow = models.BigIntegerField() - keephigh = models.BigIntegerField() - aggregation = models.BigIntegerField() - fullname = models.CharField(max_length=255) - path = models.CharField(max_length=255, blank=True) - depth = models.BigIntegerField() - parent = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField() - loggeduser = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - source = models.CharField(max_length=255, blank=True) - oldid = models.BigIntegerField() - action = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_categories_history' - - -class MdlUnittestGradeGrades(models.Model): - id = models.BigIntegerField(primary_key=True) - timemodified = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField(blank=True, null=True) - informationformat = models.BigIntegerField() - information = models.TextField(blank=True) - feedbackformat = models.BigIntegerField() - feedback = models.TextField(blank=True) - excluded = models.BigIntegerField() - overridden = models.BigIntegerField() - exported = models.BigIntegerField() - locktime = models.BigIntegerField() - locked = models.BigIntegerField() - hidden = models.BigIntegerField() - finalgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - usermodified = models.BigIntegerField(blank=True, null=True) - rawscaleid = models.BigIntegerField(blank=True, null=True) - rawgrademin = models.DecimalField(max_digits=10, decimal_places=5) - rawgrademax = models.DecimalField(max_digits=10, decimal_places=5) - rawgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - userid = models.BigIntegerField() - itemid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_grades' - - -class MdlUnittestGradeGradesHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - informationformat = models.BigIntegerField() - information = models.TextField(blank=True) - feedbackformat = models.BigIntegerField() - feedback = models.TextField(blank=True) - excluded = models.BigIntegerField() - overridden = models.BigIntegerField() - exported = models.BigIntegerField() - locktime = models.BigIntegerField() - locked = models.BigIntegerField() - hidden = models.BigIntegerField() - finalgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - usermodified = models.BigIntegerField(blank=True, null=True) - rawscaleid = models.BigIntegerField(blank=True, null=True) - rawgrademin = models.DecimalField(max_digits=10, decimal_places=5) - rawgrademax = models.DecimalField(max_digits=10, decimal_places=5) - rawgrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - userid = models.BigIntegerField() - itemid = models.BigIntegerField() - loggeduser = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - source = models.CharField(max_length=255, blank=True) - oldid = models.BigIntegerField() - action = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_grades_history' - - -class MdlUnittestGradeItems(models.Model): - id = models.BigIntegerField(primary_key=True) - timemodified = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField(blank=True, null=True) - needsupdate = models.BigIntegerField() - deleted = models.BigIntegerField() - locktime = models.BigIntegerField() - locked = models.BigIntegerField() - hidden = models.BigIntegerField() - decimals = models.SmallIntegerField(blank=True, null=True) - display = models.BigIntegerField() - sortorder = models.BigIntegerField() - plusfactor = models.DecimalField(max_digits=10, decimal_places=5) - multfactor = models.DecimalField(max_digits=10, decimal_places=5) - gradepass = models.DecimalField(max_digits=10, decimal_places=5) - outcomeid = models.BigIntegerField(blank=True, null=True) - scaleid = models.BigIntegerField(blank=True, null=True) - grademin = models.DecimalField(max_digits=10, decimal_places=5) - grademax = models.DecimalField(max_digits=10, decimal_places=5) - gradetype = models.SmallIntegerField() - calculation = models.TextField(blank=True) - idnumber = models.CharField(max_length=255, blank=True) - iteminfo = models.TextField(blank=True) - itemnumber = models.BigIntegerField(blank=True, null=True) - iteminstance = models.BigIntegerField(blank=True, null=True) - itemmodule = models.CharField(max_length=30, blank=True) - itemtype = models.CharField(max_length=30) - itemname = models.CharField(max_length=255, blank=True) - categoryid = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_items' - - -class MdlUnittestGradeItemsHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - needsupdate = models.BigIntegerField() - locktime = models.BigIntegerField() - locked = models.BigIntegerField() - hidden = models.BigIntegerField() - decimals = models.SmallIntegerField(blank=True, null=True) - display = models.BigIntegerField() - sortorder = models.BigIntegerField() - plusfactor = models.DecimalField(max_digits=10, decimal_places=5) - multfactor = models.DecimalField(max_digits=10, decimal_places=5) - gradepass = models.DecimalField(max_digits=10, decimal_places=5) - outcomeid = models.BigIntegerField(blank=True, null=True) - scaleid = models.BigIntegerField(blank=True, null=True) - grademin = models.DecimalField(max_digits=10, decimal_places=5) - grademax = models.DecimalField(max_digits=10, decimal_places=5) - gradetype = models.SmallIntegerField() - calculation = models.TextField(blank=True) - idnumber = models.CharField(max_length=255, blank=True) - iteminfo = models.TextField(blank=True) - itemnumber = models.BigIntegerField(blank=True, null=True) - iteminstance = models.BigIntegerField(blank=True, null=True) - itemmodule = models.CharField(max_length=30, blank=True) - itemtype = models.CharField(max_length=30) - itemname = models.CharField(max_length=255, blank=True) - categoryid = models.BigIntegerField(blank=True, null=True) - courseid = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - source = models.CharField(max_length=255, blank=True) - oldid = models.BigIntegerField() - action = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_items_history' - - -class MdlUnittestGradeOutcomes(models.Model): - id = models.BigIntegerField(primary_key=True) - usermodified = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField(blank=True, null=True) - scaleid = models.BigIntegerField(blank=True, null=True) - fullname = models.TextField() - shortname = models.CharField(max_length=255) - courseid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_outcomes' - - -class MdlUnittestGradeOutcomesHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - scaleid = models.BigIntegerField(blank=True, null=True) - fullname = models.TextField() - shortname = models.CharField(max_length=255) - courseid = models.BigIntegerField(blank=True, null=True) - loggeduser = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - source = models.CharField(max_length=255, blank=True) - oldid = models.BigIntegerField() - action = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_grade_outcomes_history' - - -class MdlUnittestModules(models.Model): - id = models.BigIntegerField(primary_key=True) - visible = models.SmallIntegerField() - search = models.CharField(max_length=255) - lastcron = models.BigIntegerField() - cron = models.BigIntegerField() - version = models.BigIntegerField() - name = models.CharField(max_length=20) - - class Meta: - managed = False - db_table = 'mdl_unittest_modules' - - -class MdlUnittestQuiz(models.Model): - id = models.BigIntegerField(primary_key=True) - delay2 = models.BigIntegerField() - delay1 = models.BigIntegerField() - popup = models.SmallIntegerField() - subnet = models.CharField(max_length=255) - password = models.CharField(max_length=255) - timelimit = models.BigIntegerField() - timemodified = models.BigIntegerField() - timecreated = models.BigIntegerField() - grade = models.BigIntegerField() - sumgrades = models.BigIntegerField() - questions = models.TextField() - shuffleanswers = models.SmallIntegerField() - shufflequestions = models.SmallIntegerField() - questionsperpage = models.BigIntegerField() - review = models.BigIntegerField() - decimalpoints = models.SmallIntegerField() - grademethod = models.SmallIntegerField() - attemptonlast = models.SmallIntegerField() - attempts = models.IntegerField() - penaltyscheme = models.SmallIntegerField() - optionflags = models.BigIntegerField() - timeclose = models.BigIntegerField() - timeopen = models.BigIntegerField() - intro = models.TextField() - name = models.CharField(max_length=255) - course = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_quiz' - - -class MdlUnittestScale(models.Model): - id = models.BigIntegerField(primary_key=True) - timemodified = models.BigIntegerField() - description = models.TextField() - scale = models.TextField() - name = models.CharField(max_length=255) - userid = models.BigIntegerField() - courseid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_scale' - - -class MdlUnittestScaleHistory(models.Model): - id = models.BigIntegerField(primary_key=True) - description = models.TextField() - scale = models.TextField() - name = models.CharField(max_length=255) - userid = models.BigIntegerField() - courseid = models.BigIntegerField() - loggeduser = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - source = models.CharField(max_length=255, blank=True) - oldid = models.BigIntegerField() - action = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_unittest_scale_history' - - -class MdlUpgradeLog(models.Model): - id = models.BigIntegerField(primary_key=True) - type = models.BigIntegerField() - plugin = models.CharField(max_length=100, blank=True) - version = models.CharField(max_length=100, blank=True) - targetversion = models.CharField(max_length=100, blank=True) - info = models.CharField(max_length=255) - details = models.TextField(blank=True) - backtrace = models.TextField(blank=True) - userid = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_upgrade_log' - - -class MdlUrl(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - externalurl = models.TextField() - display = models.SmallIntegerField() - displayoptions = models.TextField(blank=True) - parameters = models.TextField(blank=True) - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_url' - - -class MdlUser(models.Model): - id = models.BigIntegerField(primary_key=True) - auth = models.CharField(max_length=20) - confirmed = models.SmallIntegerField() - policyagreed = models.SmallIntegerField() - deleted = models.SmallIntegerField() - mnethostid = models.BigIntegerField() - username = models.CharField(max_length=100) - password = models.CharField(max_length=255) - firstname = models.CharField(max_length=100) - lastname = models.CharField(max_length=100) - email = models.CharField(max_length=100) - emailstop = models.SmallIntegerField() - icq = models.CharField(max_length=15) - skype = models.CharField(max_length=50) - yahoo = models.CharField(max_length=50) - aim = models.CharField(max_length=50) - msn = models.CharField(max_length=50) - phone1 = models.CharField(max_length=20) - phone2 = models.CharField(max_length=20) - institution = models.CharField(max_length=255) - department = models.CharField(max_length=255) - address = models.CharField(max_length=255) - city = models.CharField(max_length=120) - country = models.CharField(max_length=2) - lang = models.CharField(max_length=30) - theme = models.CharField(max_length=50) - timezone = models.CharField(max_length=100) - firstaccess = models.BigIntegerField() - lastaccess = models.BigIntegerField() - lastlogin = models.BigIntegerField() - currentlogin = models.BigIntegerField() - lastip = models.CharField(max_length=45) - secret = models.CharField(max_length=15) - picture = models.BigIntegerField() - url = models.CharField(max_length=255) - description = models.TextField(blank=True) - mailformat = models.SmallIntegerField() - maildigest = models.SmallIntegerField() - maildisplay = models.SmallIntegerField() - autosubscribe = models.SmallIntegerField() - trackforums = models.SmallIntegerField() - timemodified = models.BigIntegerField() - trustbitmask = models.BigIntegerField() - imagealt = models.CharField(max_length=255, blank=True) - idnumber = models.CharField(max_length=255) - descriptionformat = models.SmallIntegerField() - timecreated = models.BigIntegerField() - suspended = models.SmallIntegerField() - lastnamephonetic = models.CharField(max_length=255, blank=True) - firstnamephonetic = models.CharField(max_length=255, blank=True) - middlename = models.CharField(max_length=255, blank=True) - alternatename = models.CharField(max_length=255, blank=True) - calendartype = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_user' - - -class MdlUserDevices(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - appid = models.CharField(max_length=128) - name = models.CharField(max_length=32) - model = models.CharField(max_length=32) - platform = models.CharField(max_length=32) - version = models.CharField(max_length=32) - pushid = models.CharField(max_length=255) - uuid = models.CharField(max_length=255) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_devices' - - -class MdlUserEnrolments(models.Model): - id = models.BigIntegerField(primary_key=True) - status = models.BigIntegerField() - enrolid = models.BigIntegerField() - userid = models.BigIntegerField() - timestart = models.BigIntegerField() - timeend = models.BigIntegerField() - modifierid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_enrolments' - - -class MdlUserInfoCategory(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - sortorder = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_info_category' - - -class MdlUserInfoData(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - fieldid = models.BigIntegerField() - data = models.TextField() - dataformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_info_data' - - -class MdlUserInfoField(models.Model): - id = models.BigIntegerField(primary_key=True) - shortname = models.CharField(max_length=255) - name = models.TextField() - datatype = models.CharField(max_length=255) - description = models.TextField(blank=True) - categoryid = models.BigIntegerField() - sortorder = models.BigIntegerField() - required = models.SmallIntegerField() - locked = models.SmallIntegerField() - visible = models.SmallIntegerField() - defaultdata = models.TextField(blank=True) - param1 = models.TextField(blank=True) - param2 = models.TextField(blank=True) - param3 = models.TextField(blank=True) - param4 = models.TextField(blank=True) - param5 = models.TextField(blank=True) - forceunique = models.SmallIntegerField() - signup = models.SmallIntegerField() - defaultdataformat = models.SmallIntegerField() - descriptionformat = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_info_field' - - -class MdlUserLastaccess(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - courseid = models.BigIntegerField() - timeaccess = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_lastaccess' - - -class MdlUserPasswordResets(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - timerequested = models.BigIntegerField() - timererequested = models.BigIntegerField() - token = models.CharField(max_length=32) - - class Meta: - managed = False - db_table = 'mdl_user_password_resets' - - -class MdlUserPreferences(models.Model): - id = models.BigIntegerField(primary_key=True) - userid = models.BigIntegerField() - name = models.CharField(max_length=255) - value = models.CharField(max_length=1333) - - class Meta: - managed = False - db_table = 'mdl_user_preferences' - - -class MdlUserPrivateKey(models.Model): - id = models.BigIntegerField(primary_key=True) - script = models.CharField(max_length=128) - value = models.CharField(max_length=128) - userid = models.BigIntegerField() - instance = models.BigIntegerField(blank=True, null=True) - iprestriction = models.CharField(max_length=255, blank=True) - validuntil = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_user_private_key' - - -class MdlWebdavLocks(models.Model): - id = models.BigIntegerField(primary_key=True) - token = models.CharField(unique=True, max_length=255) - path = models.CharField(max_length=255) - expiry = models.BigIntegerField() - userid = models.BigIntegerField() - recursive = models.SmallIntegerField() - exclusivelock = models.SmallIntegerField() - created = models.BigIntegerField() - modified = models.BigIntegerField() - owner = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_webdav_locks' - - -class MdlWiki(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - timemodified = models.BigIntegerField() - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - firstpagetitle = models.CharField(max_length=255) - wikimode = models.CharField(max_length=20) - defaultformat = models.CharField(max_length=20) - forceformat = models.SmallIntegerField() - editbegin = models.BigIntegerField() - editend = models.BigIntegerField(blank=True, null=True) - timecreated = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_wiki' - - -class MdlWikiLinks(models.Model): - id = models.BigIntegerField(primary_key=True) - subwikiid = models.BigIntegerField() - frompageid = models.BigIntegerField() - topageid = models.BigIntegerField() - tomissingpage = models.CharField(max_length=255, blank=True) - - class Meta: - managed = False - db_table = 'mdl_wiki_links' - - -class MdlWikiLocks(models.Model): - id = models.BigIntegerField(primary_key=True) - pageid = models.BigIntegerField() - sectionname = models.CharField(max_length=255, blank=True) - userid = models.BigIntegerField() - lockedat = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_wiki_locks' - - -class MdlWikiPages(models.Model): - id = models.BigIntegerField(primary_key=True) - subwikiid = models.BigIntegerField() - title = models.CharField(max_length=255) - cachedcontent = models.TextField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - timerendered = models.BigIntegerField() - userid = models.BigIntegerField() - pageviews = models.BigIntegerField() - readonly = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_wiki_pages' - - -class MdlWikiSubwikis(models.Model): - id = models.BigIntegerField(primary_key=True) - wikiid = models.BigIntegerField() - groupid = models.BigIntegerField() - userid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_wiki_subwikis' - - -class MdlWikiSynonyms(models.Model): - id = models.BigIntegerField(primary_key=True) - subwikiid = models.BigIntegerField() - pageid = models.BigIntegerField() - pagesynonym = models.CharField(max_length=255) - - class Meta: - managed = False - db_table = 'mdl_wiki_synonyms' - - -class MdlWikiVersions(models.Model): - id = models.BigIntegerField(primary_key=True) - pageid = models.BigIntegerField() - content = models.TextField() - contentformat = models.CharField(max_length=20) - version = models.IntegerField() - timecreated = models.BigIntegerField() - userid = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_wiki_versions' - - -class MdlWorkshop(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - intro = models.TextField(blank=True) - introformat = models.SmallIntegerField() - instructauthors = models.TextField(blank=True) - instructauthorsformat = models.SmallIntegerField() - instructreviewers = models.TextField(blank=True) - instructreviewersformat = models.SmallIntegerField() - timemodified = models.BigIntegerField() - phase = models.SmallIntegerField(blank=True, null=True) - useexamples = models.SmallIntegerField(blank=True, null=True) - usepeerassessment = models.SmallIntegerField(blank=True, null=True) - useselfassessment = models.SmallIntegerField(blank=True, null=True) - grade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - gradinggrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - strategy = models.CharField(max_length=30) - gradedecimals = models.SmallIntegerField(blank=True, null=True) - nattachments = models.SmallIntegerField(blank=True, null=True) - latesubmissions = models.SmallIntegerField(blank=True, null=True) - maxbytes = models.BigIntegerField(blank=True, null=True) - examplesmode = models.SmallIntegerField(blank=True, null=True) - submissionstart = models.BigIntegerField(blank=True, null=True) - submissionend = models.BigIntegerField(blank=True, null=True) - assessmentstart = models.BigIntegerField(blank=True, null=True) - assessmentend = models.BigIntegerField(blank=True, null=True) - evaluation = models.CharField(max_length=30) - phaseswitchassessment = models.SmallIntegerField() - conclusion = models.TextField(blank=True) - conclusionformat = models.SmallIntegerField() - overallfeedbackmode = models.SmallIntegerField(blank=True, null=True) - overallfeedbackfiles = models.SmallIntegerField(blank=True, null=True) - overallfeedbackmaxbytes = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop' - - -class MdlWorkshopAggregations(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - userid = models.BigIntegerField() - gradinggrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - timegraded = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_aggregations' - - -class MdlWorkshopAssessments(models.Model): - id = models.BigIntegerField(primary_key=True) - submissionid = models.BigIntegerField() - reviewerid = models.BigIntegerField() - weight = models.BigIntegerField() - timecreated = models.BigIntegerField(blank=True, null=True) - timemodified = models.BigIntegerField(blank=True, null=True) - grade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - gradinggrade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - gradinggradeover = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - gradinggradeoverby = models.BigIntegerField(blank=True, null=True) - feedbackauthor = models.TextField(blank=True) - feedbackauthorformat = models.SmallIntegerField(blank=True, null=True) - feedbackreviewer = models.TextField(blank=True) - feedbackreviewerformat = models.SmallIntegerField(blank=True, null=True) - feedbackauthorattachment = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_assessments' - - -class MdlWorkshopAssessmentsOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - submissionid = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timegraded = models.BigIntegerField() - timeagreed = models.BigIntegerField() - grade = models.FloatField() - gradinggrade = models.SmallIntegerField() - teachergraded = models.SmallIntegerField() - mailed = models.SmallIntegerField() - resubmission = models.SmallIntegerField() - donotuse = models.SmallIntegerField() - generalcomment = models.TextField() - teachercomment = models.TextField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_assessments_old' - - -class MdlWorkshopCommentsOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - assessmentid = models.BigIntegerField() - userid = models.BigIntegerField() - timecreated = models.BigIntegerField() - mailed = models.SmallIntegerField() - comments = models.TextField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_comments_old' - - -class MdlWorkshopElementsOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - elementno = models.SmallIntegerField() - description = models.TextField() - scale = models.SmallIntegerField() - maxscore = models.SmallIntegerField() - weight = models.SmallIntegerField() - stddev = models.FloatField() - totalassessments = models.BigIntegerField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_elements_old' - - -class MdlWorkshopGrades(models.Model): - id = models.BigIntegerField(primary_key=True) - assessmentid = models.BigIntegerField() - strategy = models.CharField(max_length=30) - dimensionid = models.BigIntegerField() - grade = models.DecimalField(max_digits=10, decimal_places=5) - peercomment = models.TextField(blank=True) - peercommentformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_grades' - - -class MdlWorkshopGradesOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - assessmentid = models.BigIntegerField() - elementno = models.BigIntegerField() - feedback = models.TextField() - grade = models.SmallIntegerField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_grades_old' - - -class MdlWorkshopOld(models.Model): - id = models.BigIntegerField(primary_key=True) - course = models.BigIntegerField() - name = models.CharField(max_length=255) - description = models.TextField() - wtype = models.SmallIntegerField() - nelements = models.SmallIntegerField() - nattachments = models.SmallIntegerField() - phase = models.SmallIntegerField() - format = models.SmallIntegerField() - gradingstrategy = models.SmallIntegerField() - resubmit = models.SmallIntegerField() - agreeassessments = models.SmallIntegerField() - hidegrades = models.SmallIntegerField() - anonymous = models.SmallIntegerField() - includeself = models.SmallIntegerField() - maxbytes = models.BigIntegerField() - submissionstart = models.BigIntegerField() - assessmentstart = models.BigIntegerField() - submissionend = models.BigIntegerField() - assessmentend = models.BigIntegerField() - releasegrades = models.BigIntegerField() - grade = models.SmallIntegerField() - gradinggrade = models.SmallIntegerField() - ntassessments = models.SmallIntegerField() - assessmentcomps = models.SmallIntegerField() - nsassessments = models.SmallIntegerField() - overallocation = models.SmallIntegerField() - timemodified = models.BigIntegerField() - teacherweight = models.SmallIntegerField() - showleaguetable = models.SmallIntegerField() - usepassword = models.SmallIntegerField() - password = models.CharField(max_length=32) - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_old' - - -class MdlWorkshopRubricsOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - elementno = models.BigIntegerField() - rubricno = models.SmallIntegerField() - description = models.TextField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_rubrics_old' - - -class MdlWorkshopStockcommentsOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - elementno = models.BigIntegerField() - comments = models.TextField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_stockcomments_old' - - -class MdlWorkshopSubmissions(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - example = models.SmallIntegerField(blank=True, null=True) - authorid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - title = models.CharField(max_length=255) - content = models.TextField(blank=True) - contentformat = models.SmallIntegerField() - contenttrust = models.SmallIntegerField() - attachment = models.SmallIntegerField(blank=True, null=True) - grade = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - gradeover = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) - gradeoverby = models.BigIntegerField(blank=True, null=True) - feedbackauthor = models.TextField(blank=True) - feedbackauthorformat = models.SmallIntegerField(blank=True, null=True) - timegraded = models.BigIntegerField(blank=True, null=True) - published = models.SmallIntegerField(blank=True, null=True) - late = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_workshop_submissions' - - -class MdlWorkshopSubmissionsOld(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - userid = models.BigIntegerField() - title = models.CharField(max_length=100) - timecreated = models.BigIntegerField() - mailed = models.SmallIntegerField() - description = models.TextField() - gradinggrade = models.SmallIntegerField() - finalgrade = models.SmallIntegerField() - late = models.SmallIntegerField() - nassessments = models.BigIntegerField() - newplugin = models.CharField(max_length=28, blank=True) - newid = models.BigIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshop_submissions_old' - - -class MdlWorkshopallocationScheduled(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField(unique=True) - enabled = models.SmallIntegerField() - submissionend = models.BigIntegerField() - timeallocated = models.BigIntegerField(blank=True, null=True) - settings = models.TextField(blank=True) - resultstatus = models.BigIntegerField(blank=True, null=True) - resultmessage = models.CharField(max_length=1333, blank=True) - resultlog = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_workshopallocation_scheduled' - - -class MdlWorkshopevalBestSettings(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField(unique=True) - comparison = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshopeval_best_settings' - - -class MdlWorkshopformAccumulative(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - sort = models.BigIntegerField(blank=True, null=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - grade = models.BigIntegerField() - weight = models.IntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshopform_accumulative' - - -class MdlWorkshopformComments(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - sort = models.BigIntegerField(blank=True, null=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshopform_comments' - - -class MdlWorkshopformNumerrors(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - sort = models.BigIntegerField(blank=True, null=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - descriptiontrust = models.BigIntegerField(blank=True, null=True) - grade0 = models.CharField(max_length=50, blank=True) - grade1 = models.CharField(max_length=50, blank=True) - weight = models.IntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshopform_numerrors' - - -class MdlWorkshopformNumerrorsMap(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - nonegative = models.BigIntegerField() - grade = models.DecimalField(max_digits=10, decimal_places=5) - - class Meta: - managed = False - db_table = 'mdl_workshopform_numerrors_map' - - -class MdlWorkshopformRubric(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField() - sort = models.BigIntegerField(blank=True, null=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshopform_rubric' - - -class MdlWorkshopformRubricConfig(models.Model): - id = models.BigIntegerField(primary_key=True) - workshopid = models.BigIntegerField(unique=True) - layout = models.CharField(max_length=30, blank=True) - - class Meta: - managed = False - db_table = 'mdl_workshopform_rubric_config' - - -class MdlWorkshopformRubricLevels(models.Model): - id = models.BigIntegerField(primary_key=True) - dimensionid = models.BigIntegerField() - grade = models.DecimalField(max_digits=10, decimal_places=5) - definition = models.TextField(blank=True) - definitionformat = models.SmallIntegerField(blank=True, null=True) - - class Meta: - managed = False - db_table = 'mdl_workshopform_rubric_levels' diff --git a/sigi/apps/mdl/migrations/0001_initial.py b/sigi/apps/mdl/migrations/0001_initial.py deleted file mode 100644 index 25c0a64..0000000 --- a/sigi/apps/mdl/migrations/0001_initial.py +++ /dev/null @@ -1,116 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Cohort', - fields=[ - ], - options={ - 'db_table': 'mdl_cohort', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='CohortMembers', - fields=[ - ], - options={ - 'db_table': 'mdl_cohort_members', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='Context', - fields=[ - ], - options={ - 'db_table': 'mdl_context', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='Course', - fields=[ - ], - options={ - 'ordering': ['sortorder'], - 'db_table': 'mdl_course', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='CourseCategories', - fields=[ - ], - options={ - 'ordering': ['sortorder'], - 'db_table': 'mdl_course_categories', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='CourseCompletions', - fields=[ - ], - options={ - 'db_table': 'mdl_course_completions', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='CourseStats', - fields=[ - ], - options={ - 'db_table': 'sigi_course_stats', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='Enrol', - fields=[ - ], - options={ - 'ordering': ['sortorder'], - 'db_table': 'mdl_enrol', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='User', - fields=[ - ], - options={ - 'db_table': 'mdl_user', - 'managed': False, - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='UserEnrolments', - fields=[ - ], - options={ - 'db_table': 'mdl_user_enrolments', - 'managed': False, - }, - bases=(models.Model,), - ), - ] diff --git a/sigi/apps/mdl/migrations/__init__.py b/sigi/apps/mdl/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sigi/apps/mdl/models.py b/sigi/apps/mdl/models.py deleted file mode 100644 index 0466b45..0000000 --- a/sigi/apps/mdl/models.py +++ /dev/null @@ -1,360 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals -from django.db import models - - -class CourseStats(models.Model): - # databaseview: (postgresql dialect): - # -- View: sigi_course_stats - # - # DROP VIEW sigi_course_stats; - # - # CREATE OR REPLACE VIEW sigi_course_stats AS - # SELECT cc.id AS categoryid, c.id AS courseid, - # CASE - # WHEN e.enrol = 'ilbeadtutorado' AND ue.status = 1 THEN 'N' -- Rejeitada - # WHEN e.enrol = 'ilbead' AND ue.timeend > date_part('epoch', now()) THEN 'C' -- Em curso - # WHEN e.enrol = 'ilbead' and ue.timeend < date_part('epoch', now()) and co.timecompleted is null and gg.finalgrade is null then 'L' -- Abandono - # WHEN (co.timestarted = 0 OR co.timestarted IS NULL) AND gg.finalgrade IS NOT NULL THEN 'R' -- Reprovada - # WHEN co.timestarted = 0 OR co.timestarted IS NULL THEN 'L' -- Abandono - # WHEN co.timestarted > 0 AND co.timecompleted IS NULL THEN 'R' -- Reprovado - # WHEN co.timecompleted IS NOT NULL THEN 'A' -- Aprovado - # ELSE 'I' -- Indeterminado - # END AS completionstatus, count(ue.id) AS usercount, avg(gg.finalgrade) as gradeaverage - # FROM mdl_course_categories cc - # JOIN mdl_course c ON c.category = cc.id - # JOIN mdl_enrol e ON e.courseid = c.id - # JOIN mdl_user_enrolments ue ON ue.enrolid = e.id - # JOIN mdl_grade_items gi ON gi.courseid = c.id AND gi.itemtype = 'course' - # LEFT JOIN mdl_grade_grades gg ON gg.itemid = gi.id AND gg.userid = ue.userid - # LEFT JOIN mdl_course_completions co ON co.userid = ue.userid AND co.course = c.id - # GROUP BY cc.id, c.id, completionstatus; - - COMPLETIONSTATUS_CHOICES = ( - ('N', u'Matrículas rejeitadas'), - ('C', u'Em curso'), - ('R', u'Reprovação'), - ('L', u'Abandono'), - ('A', u'Aprovação'), - ('I', u'Indeterminado'),) - - category = models.ForeignKey('CourseCategories', db_column='categoryid', primary_key=True) - course = models.ForeignKey('Course', db_column='courseid') - completionstatus = models.CharField(max_length=1, choices=COMPLETIONSTATUS_CHOICES) - usercount = models.IntegerField() - gradeaverage = models.FloatField() - - class Meta: - managed = False - db_table = 'sigi_course_stats' - - def __unicode__(self): - return '%s - %s: %s' % (self.category.name, self.course.fullname, self.usercount) - - -class Cohort(models.Model): - id = models.BigIntegerField(primary_key=True) - context = models.ForeignKey('Context', db_column='contextid') - name = models.CharField(max_length=254) - idnumber = models.CharField(max_length=100, blank=True) - description = models.TextField(blank=True) - descriptionformat = models.SmallIntegerField() - component = models.CharField(max_length=100) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - visible = models.SmallIntegerField() - # Manytomany - members = models.ManyToManyField('User', through='CohortMembers') - - class Meta: - managed = False - db_table = 'mdl_cohort' - - def __unicode__(self): - return self.name - - -class CohortMembers(models.Model): - id = models.BigIntegerField(primary_key=True) - cohort = models.ForeignKey('Cohort', db_column='cohortid') - user = models.ForeignKey('User', db_column='userid') - timeadded = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_cohort_members' - - -class Context(models.Model): - CONTEXT_SYSTEM = 10 # System context level - only one instance in every system - CONTEXT_USER = 30 # User context level - one instance for each user describing what others can do to user - CONTEXT_COURSECAT = 40 # Course category context level - one instance for each category - CONTEXT_COURSE = 50 # Course context level - one instances for each course - CONTEXT_MODULE = 70 # Course module context level - one instance for each course module - CONTEXT_BLOCK = 80 # Block context level - one instance for each block, sticky blocks are tricky - # because ppl think they should be able to override them at lower contexts. - # Any other context level instance can be parent of block context. - - id = models.BigIntegerField(primary_key=True) - contextlevel = models.BigIntegerField() - instanceid = models.BigIntegerField() - path = models.CharField(max_length=255, blank=True) - depth = models.SmallIntegerField() - - class Meta: - managed = False - db_table = 'mdl_context' - - def __unicode__(self): - return self.path - - -class Course(models.Model): - id = models.BigIntegerField(primary_key=True) - category = models.ForeignKey('CourseCategories', db_column='category', related_name='courses') - sortorder = models.BigIntegerField() - fullname = models.CharField(max_length=254) - shortname = models.CharField(max_length=255) - idnumber = models.CharField(max_length=100) - summary = models.TextField(blank=True) - format = models.CharField(max_length=21) - showgrades = models.SmallIntegerField() - newsitems = models.IntegerField() - startdate = models.BigIntegerField() - marker = models.BigIntegerField() - maxbytes = models.BigIntegerField() - showreports = models.SmallIntegerField() - visible = models.SmallIntegerField() - groupmode = models.SmallIntegerField() - groupmodeforce = models.SmallIntegerField() - lang = models.CharField(max_length=30) - theme = models.CharField(max_length=50) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - requested = models.SmallIntegerField() - defaultgroupingid = models.BigIntegerField() - enrolmax = models.BigIntegerField() - enablecompletion = models.SmallIntegerField() - legacyfiles = models.SmallIntegerField() - summaryformat = models.SmallIntegerField() - completionnotify = models.SmallIntegerField() - visibleold = models.SmallIntegerField() - calendartype = models.CharField(max_length=30) - cacherev = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_course' - ordering = ['sortorder', ] - - def __unicode__(self): - return self.fullname - - def total_alunos(self): - return sum(e.user_enrolments.count() for e in self.enrols.all()) - - def total_ativos(self): - return sum(e.user_enrolments.filter(status=0).count() for e in self.enrols.all()) - - def get_matriculas(self): - q = UserEnrolments.objects.none() - for e in self.enrols.all(): - q = q | e.user_enrolments.all() - return q - - -class CourseCategories(models.Model): - id = models.BigIntegerField(primary_key=True) - name = models.CharField(max_length=255) - description = models.TextField(blank=True) - parent = models.ForeignKey('CourseCategories', db_column='parent', related_name='children') - sortorder = models.BigIntegerField() - coursecount = models.BigIntegerField() - visible = models.SmallIntegerField() - timemodified = models.BigIntegerField() - depth = models.BigIntegerField() - path = models.CharField(max_length=255) - theme = models.CharField(max_length=50, blank=True) - descriptionformat = models.SmallIntegerField() - visibleold = models.SmallIntegerField() - idnumber = models.CharField(max_length=100, blank=True) - - class Meta: - managed = False - db_table = 'mdl_course_categories' - ordering = ['sortorder', ] - - def __unicode__(self): - return self.name - - def context(self): - return Context.objects.get(instanceid=self.id, contextlevel=Context.CONTEXT_COURSECAT) - - def total_turmas(self): - return self.coursecount + sum([c.coursecount for c in self.children.all()]) - - def total_alunos(self): - total = 0 - total = total + sum(c.total_alunos() for c in self.courses.all()) - total = total + sum(c.total_alunos() for c in self.children.all()) - return total - - def cohortids(self): - cids = [c.pk for c in self.context().cohort_set.all()] - for c in self.children.all(): - cids = cids + c.cohortids() - return cids - - def total_alunos_cohort(self): - return sum([c.members.distinct().count() for c in Cohort.objects.filter(pk__in=self.cohortids())]) - - def get_all_courses(self, only_visible=False): - if only_visible: - q = self.courses.filter(visible=1) - else: - q = self.courses.all() - for c in self.children.all(): - q = q | c.get_all_courses(only_visible=only_visible) - return q - - -class CourseCompletions(models.Model): - id = models.BigIntegerField(primary_key=True) - user = models.ForeignKey('User', db_column='userid') - course = models.ForeignKey('Course', db_column='course') - timeenrolled = models.BigIntegerField() - timestarted = models.BigIntegerField() - timecompleted = models.BigIntegerField(blank=True, null=True) - reaggregate = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_course_completions' - - -class Enrol(models.Model): - id = models.BigIntegerField(primary_key=True) - enrol = models.CharField(max_length=20) - status = models.BigIntegerField() - course = models.ForeignKey('Course', db_column='courseid', related_name='enrols') - sortorder = models.BigIntegerField() - name = models.CharField(max_length=255, blank=True) - enrolperiod = models.BigIntegerField(blank=True, null=True) - enrolstartdate = models.BigIntegerField(blank=True, null=True) - enrolenddate = models.BigIntegerField(blank=True, null=True) - expirynotify = models.SmallIntegerField(blank=True, null=True) - expirythreshold = models.BigIntegerField(blank=True, null=True) - notifyall = models.SmallIntegerField(blank=True, null=True) - password = models.CharField(max_length=50, blank=True) - cost = models.CharField(max_length=20, blank=True) - currency = models.CharField(max_length=3, blank=True) - roleid = models.BigIntegerField(blank=True, null=True) - customint1 = models.BigIntegerField(blank=True, null=True) - customint2 = models.BigIntegerField(blank=True, null=True) - customint3 = models.BigIntegerField(blank=True, null=True) - customint4 = models.BigIntegerField(blank=True, null=True) - customchar1 = models.CharField(max_length=255, blank=True) - customchar2 = models.CharField(max_length=255, blank=True) - customdec1 = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - customdec2 = models.DecimalField(max_digits=12, decimal_places=7, blank=True, null=True) - customtext1 = models.TextField(blank=True) - customtext2 = models.TextField(blank=True) - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - customint5 = models.BigIntegerField(blank=True, null=True) - customint6 = models.BigIntegerField(blank=True, null=True) - customint7 = models.BigIntegerField(blank=True, null=True) - customint8 = models.BigIntegerField(blank=True, null=True) - customchar3 = models.CharField(max_length=1333, blank=True) - customtext3 = models.TextField(blank=True) - customtext4 = models.TextField(blank=True) - - class Meta: - managed = False - db_table = 'mdl_enrol' - ordering = ['sortorder', ] - - def __unicode__(self): - if not self.name: - return self.enrol - return self.name - - -class User(models.Model): - id = models.BigIntegerField(primary_key=True) - auth = models.CharField(max_length=20) - confirmed = models.SmallIntegerField() - policyagreed = models.SmallIntegerField() - deleted = models.SmallIntegerField() - mnethostid = models.BigIntegerField() - username = models.CharField(max_length=100) - password = models.CharField(max_length=255) - firstname = models.CharField(max_length=100) - lastname = models.CharField(max_length=100) - email = models.CharField(max_length=100) - emailstop = models.SmallIntegerField() - icq = models.CharField(max_length=15) - skype = models.CharField(max_length=50) - yahoo = models.CharField(max_length=50) - aim = models.CharField(max_length=50) - msn = models.CharField(max_length=50) - phone1 = models.CharField(max_length=20) - phone2 = models.CharField(max_length=20) - institution = models.CharField(max_length=255) - department = models.CharField(max_length=255) - address = models.CharField(max_length=255) - city = models.CharField(max_length=120) - country = models.CharField(max_length=2) - lang = models.CharField(max_length=30) - theme = models.CharField(max_length=50) - timezone = models.CharField(max_length=100) - firstaccess = models.BigIntegerField() - lastaccess = models.BigIntegerField() - lastlogin = models.BigIntegerField() - currentlogin = models.BigIntegerField() - lastip = models.CharField(max_length=45) - secret = models.CharField(max_length=15) - picture = models.BigIntegerField() - url = models.CharField(max_length=255) - description = models.TextField(blank=True) - mailformat = models.SmallIntegerField() - maildigest = models.SmallIntegerField() - maildisplay = models.SmallIntegerField() - autosubscribe = models.SmallIntegerField() - trackforums = models.SmallIntegerField() - timemodified = models.BigIntegerField() - trustbitmask = models.BigIntegerField() - imagealt = models.CharField(max_length=255, blank=True) - idnumber = models.CharField(max_length=255) - descriptionformat = models.SmallIntegerField() - timecreated = models.BigIntegerField() - suspended = models.SmallIntegerField() - lastnamephonetic = models.CharField(max_length=255, blank=True) - firstnamephonetic = models.CharField(max_length=255, blank=True) - middlename = models.CharField(max_length=255, blank=True) - alternatename = models.CharField(max_length=255, blank=True) - calendartype = models.CharField(max_length=30) - - class Meta: - managed = False - db_table = 'mdl_user' - - def __unicode__(self): - return u'%s %s' % (self.firstname, self.lastname) - - -class UserEnrolments(models.Model): - id = models.BigIntegerField(primary_key=True) - status = models.BigIntegerField() - enrol = models.ForeignKey('Enrol', db_column='enrolid', related_name='user_enrolments') - user = models.ForeignKey('User', db_column='userid', related_name='Enrolments') - timestart = models.BigIntegerField() - timeend = models.BigIntegerField() - modifierid = models.BigIntegerField() - timecreated = models.BigIntegerField() - timemodified = models.BigIntegerField() - - class Meta: - managed = False - db_table = 'mdl_user_enrolments' diff --git a/sigi/apps/mdl/views.py b/sigi/apps/mdl/views.py deleted file mode 100644 index 91ea44a..0000000 --- a/sigi/apps/mdl/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/sigi/apps/saberes/__init__.py b/sigi/apps/saberes/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sigi/apps/saberes/admin.py b/sigi/apps/saberes/admin.py deleted file mode 100644 index e9749de..0000000 --- a/sigi/apps/saberes/admin.py +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -from django.utils.translation import ugettext as _ -from django.contrib import admin -from sigi.apps.saberes.models import CategoriasInteresse - - -class CategoriasInteresseAdmin(admin.ModelAdmin): - list_display = ('prefixo', 'descricao', 'count_categorias',) - - def count_categorias(self, obj): - return obj.categorias().count() - count_categorias.short_description = _("Categorias que casam") -admin.site.register(CategoriasInteresse, CategoriasInteresseAdmin) diff --git a/sigi/apps/saberes/management/__init__.py b/sigi/apps/saberes/management/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sigi/apps/saberes/management/commands/__init__.py b/sigi/apps/saberes/management/commands/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sigi/apps/saberes/management/commands/get_moodle_stats.py b/sigi/apps/saberes/management/commands/get_moodle_stats.py deleted file mode 100644 index 29dcfb2..0000000 --- a/sigi/apps/saberes/management/commands/get_moodle_stats.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- -# -# sigi.apps.servicos.management.commands.get_moodle_stats -# -# Copyright (c) 2014 by Interlegis -# -# GNU General Public License (GPL) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -from django.utils.translation import ugettext as _ -from django.core.management.base import BaseCommand -from django.db.models import Sum, Avg -from sigi.apps.metas.views import gera_map_data_file -from sigi.apps.saberes.models import CategoriasInteresse, PainelItem -from sigi.apps.mdl.models import User, CourseStats - - -class Command(BaseCommand): - help = u'Get Moodle data and generate statistical panels.' - - def handle(self, *args, **options): - areas = [] - numeros = [ - {'descricao': _(u'Total de usuários cadastrados'), 'valor': User.objects.count()}, - {'descricao': _(u'Novos usuários cadastrados'), 'valor': User.objects.filter(firstaccess__gte=1392326052).count()} - ] - - for ci in CategoriasInteresse.objects.all(): - if ci.coorte: - total_matriculas = ci.total_alunos_coorte() - elif ci.apurar_conclusao: - data = {x['completionstatus']: x for x in CourseStats.objects.filter(category__in=ci.categorias(subcategorias=True)). - values('completionstatus').annotate(total_users=Sum('usercount'), grade_average=Avg('gradeaverage'))} - total_matriculas = sum(x['total_users'] for k, x in data.items()) - else: - total_matriculas = CourseStats.objects.filter(category__in=ci.categorias(subcategorias=True)). \ - aggregate(total_users=Sum('usercount'))['total_users'] - - dados = [{'descricao': _(u'Total de matrículas'), 'valor': total_matriculas}] - - if ci.coorte: - for c in ci.categorias(subcategorias=True): - dados.append({'descricao': c.name, 'valor': c.total_alunos_cohort()}) - - if ci.apurar_conclusao: - if 'N' in data: - dados.append({'descricao': _(u'Matrículas rejeitadas'), 'help_text': _(u'demanda reprimida'), - 'valor': data['N']['total_users'], 'percentual': 100.0 * data['N']['total_users'] / total_matriculas}) - total_alunos = total_matriculas - data['N']['total_users'] - dados.append({'descricao': _(u'Alunos efetivos'), 'help_text': _(u'os percentuais seguintes se referem a este indicador'), - 'valor': total_alunos}) - else: - total_alunos = total_matriculas - - if 'C' in data: - dados.append({'descricao': _(u'Alunos em curso'), 'valor': data['C']['total_users'], - 'percentual': 100.0 * data['C']['total_users'] / total_alunos}) - if 'L' in data: - dados.append({'descricao': _(u'Alunos que abandonaram o curso'), 'valor': data['L']['total_users'], - 'percentual': 100.0 * data['L']['total_users'] / total_alunos}) - if 'R' in data: - dados.append({'descricao': _(u'Alunos reprovados'), 'valor': data['R']['total_users'], - 'percentual': 100.0 * data['R']['total_users'] / total_alunos}) - if 'A' in data: - dados.append({'descricao': _(u'Alunos aprovados'), 'valor': data['A']['total_users'], - 'percentual': 100.0 * data['A']['total_users'] / total_alunos}) - - if 'I' in data: - dados.append({'descricao': _(u'Situação indefinida'), 'valor': data['I']['total_users'], - 'help_text': _(u'Situação do aluno não pode ser determinada pelo sistema'), - 'percentual': 100.0 * data['I']['total_users'] / total_alunos}) - - if 'A' in data: - dados.append({'descricao': _(u'Média das notas dos alunos aprovados (%)'), 'valor': int(data['A']['grade_average'])}) - - if 'R' in data: - dados.append({'descricao': _(u'Média das notas dos alunos reprovados (%)'), 'valor': int(data['R']['grade_average'])}) - - areas.append({'titulo': ci.descricao, 'dados': dados}) - - paineis = [{'titulo': _(u'Saberes em números'), 'dados': numeros}] + areas - - PainelItem.objects.all().delete() # Clear dashboard - - for p in paineis: - for d in p['dados']: - PainelItem.objects.create(painel=p['titulo'], descricao=d['descricao'], help_text=d['help_text'] if 'help_text' in - d else '', valor=d['valor'], percentual=d['percentual'] if 'percentual' in d else None) diff --git a/sigi/apps/saberes/migrations/0001_initial.py b/sigi/apps/saberes/migrations/0001_initial.py deleted file mode 100644 index 0b4574f..0000000 --- a/sigi/apps/saberes/migrations/0001_initial.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='CategoriasInteresse', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('prefixo', models.CharField(help_text='Identifica as categorias no Moodle (campo idnumber) relacionadas a este interesse', max_length=100, verbose_name='Prefixo das categorias no Moodle')), - ('descricao', models.CharField(max_length=100, verbose_name='Descri\xe7\xe3o')), - ('sigla', models.CharField(max_length=20, verbose_name='Sigla')), - ('coorte', models.BooleanField(default=False, help_text='Usa cohorte para calcular o n\xfamero de matr\xedculas/alunos', verbose_name='Usa Cohorte')), - ('apurar_alunos', models.BooleanField(default=False, help_text='Indica que deve-se verificar o perfil da inscri\xe7\xe3o para saber se \xe9 um aluno ou se a matr\xedcula foi rejeitada', verbose_name='Apurar alunos')), - ('apurar_conclusao', models.BooleanField(default=False, help_text='Indica se o dashboard mostrar\xe1 o n\xfamero de alunos aprovados, reprovados e desistentes', verbose_name='Apurar conclus\xe3o')), - ], - options={ - 'verbose_name': 'Categorias de interesse', - }, - bases=(models.Model,), - ), - migrations.CreateModel( - name='PainelItem', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('painel', models.CharField(max_length=255)), - ('descricao', models.CharField(max_length=255)), - ('help_text', models.CharField(max_length=255)), - ('valor', models.IntegerField()), - ('percentual', models.FloatField(null=True)), - ], - options={ - 'ordering': ['pk'], - }, - bases=(models.Model,), - ), - ] diff --git a/sigi/apps/saberes/migrations/__init__.py b/sigi/apps/saberes/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sigi/apps/saberes/models.py b/sigi/apps/saberes/models.py deleted file mode 100644 index a200aeb..0000000 --- a/sigi/apps/saberes/models.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals -from django.utils.translation import ugettext as _ -from django.db import models -from django.db.models import Q -from sigi.apps.mdl.models import Course, CourseCategories, CourseCompletions, UserEnrolments - - -class CategoriasInteresse(models.Model): - prefixo = models.CharField(_(u"Prefixo das categorias no Moodle"), max_length=100, - help_text=_(u"Identifica as categorias no Moodle (campo idnumber) relacionadas a este interesse")) - descricao = models.CharField(_(u"Descrição"), max_length=100) - sigla = models.CharField(_(u"Sigla"), max_length=20) - coorte = models.BooleanField(_(u"Usa Cohorte"), default=False, help_text=_(u"Usa cohorte para calcular o número de matrículas/alunos")) - apurar_alunos = models.BooleanField(_(u"Apurar alunos"), default=False, help_text=_(u"Indica que deve-se verificar o perfil da" - + " inscrição para saber se é um aluno ou se a matrícula foi rejeitada")) - apurar_conclusao = models.BooleanField(_(u"Apurar conclusão"), default=False, help_text=_(u"Indica se o dashboard mostrará o " - + "número de alunos aprovados, reprovados e desistentes")) - - class Meta: - verbose_name = _(u'Categorias de interesse') - - def __unicode__(self): - return self.descricao - - def categorias(self, subcategorias=False): - def get_sub_categorias(categorias): - result = CourseCategories.objects.none() - for c in categorias: - c_children = CourseCategories.objects.filter(parent=c) - result = result | c_children | get_sub_categorias(c_children) - return result - - q = CourseCategories.objects.filter(idnumber__startswith=self.prefixo) - - if subcategorias: - q = q | get_sub_categorias(q) - - return q - - def get_all_courses(self, only_visible=False): - q = Course.objects.none() - for categoria in self.categorias(): - q = q | categoria.get_all_courses(only_visible=only_visible) - return q - - def get_all_completions(self): - q = CourseCompletions.objects.none() - for c in self.get_all_courses(): - q = q | c.coursecompletions_set.all() - return q - - def get_all_enrolments(self): - q = UserEnrolments.objects.none() - for c in self.get_all_courses(): - q = q | c.get_matriculas() - return q - - def total_alunos_coorte(self): - return sum(c.total_alunos_cohort() for c in self.categorias()) - -# A temporary model to store Moodle processed data by management command (called from CRON) - - -class PainelItem(models.Model): - painel = models.CharField(max_length=255) - descricao = models.CharField(max_length=255) - help_text = models.CharField(max_length=255) - valor = models.IntegerField() - percentual = models.FloatField(null=True) - - class Meta: - ordering = ['pk'] diff --git a/sigi/apps/saberes/templates/saberes/dashboard.html b/sigi/apps/saberes/templates/saberes/dashboard.html deleted file mode 100644 index 675b67b..0000000 --- a/sigi/apps/saberes/templates/saberes/dashboard.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "admin/base_site.html" %} - -{# turned off to avoid bootstrap version conflict #} -{% block default_javascript %}{% endblock %} - -{% block extrahead %} - {{ block.super }} - {{ headers|safe }} -{% endblock %} - -{% block content %} - {{ content|safe }} -{% endblock %} diff --git a/sigi/apps/saberes/templates/saberes/detail.html b/sigi/apps/saberes/templates/saberes/detail.html deleted file mode 100644 index 64dedcc..0000000 --- a/sigi/apps/saberes/templates/saberes/detail.html +++ /dev/null @@ -1,50 +0,0 @@ -{% extends "admin/base_site.html" %} - -{% block extrastyle %} - {{ block.super }} - -{% endblock %} - -{% block content %} -
    - - -
    - - - - {% for col_title in table_head %} - - {% endfor %} - - - - {% for k, row in table_data.items %} - - - - {% if 'N' in flags %} - - - {% endif %} - {% if 'C' in flags %}{% endif %} - {% if 'L' in flags %}{% endif %} - {% if 'R' in flags %}{% endif %} - {% if 'A' in flags %}{% endif %} - {% if 'MA' in flags %}{% endif %} - {% if 'MR' in flags %}{% endif %} - - {% endfor %} - -
    {{ col_title }}
    {{ row.course_name }}{{ row.total_matriculas }}{{ row.N }}{{ row.efetivos }}{{ row.C }}{{ row.L }}{{ row.R }}{{ row.A }}{{ row.media_aprovados|floatformat:2 }}{{ row.media_reprovados|floatformat:2 }}
    -
    -
    -{% endblock %} diff --git a/sigi/apps/saberes/templates/saberes/snippets.html b/sigi/apps/saberes/templates/saberes/snippets.html deleted file mode 100644 index 02daccc..0000000 --- a/sigi/apps/saberes/templates/saberes/snippets.html +++ /dev/null @@ -1,33 +0,0 @@ -
    - {% for k, painel in paineis.items %} -
    -
    -
    - {{ painel.titulo }} - {% if painel.area %} - Detalhes - {% endif %} -
    -
    - - {% for linha in painel.dados %} - - - - {% if linha.percentual %} - - {% endif %} - - {% endfor %} -
    - {{ linha.descricao }} - {% if linha.help_text %} - {{ linha.help_text }} - {% endif %} - {{ linha.valor }}{{ linha.percentual|floatformat:2 }}%
    -
    -
    -
    - {% cycle '' '' '
    ' %} - {% endfor %} -
    diff --git a/sigi/apps/saberes/urls.py b/sigi/apps/saberes/urls.py deleted file mode 100644 index 05254fc..0000000 --- a/sigi/apps/saberes/urls.py +++ /dev/null @@ -1,14 +0,0 @@ -# coding: utf-8 -from django.conf.urls import patterns, url - -from .views import cursos_sem_tutoria, cursos_com_tutoria, dashboard, pentaho_proxy - - -urlpatterns = patterns( - 'sigi.apps.saberes.views', - - url(r'^dashboard/cursos-sem-turoria/?$', cursos_sem_tutoria, name="saberes-cursos-sem-tutoria"), - 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(plugin|api)/.*)$', pentaho_proxy), -) diff --git a/sigi/apps/saberes/views.py b/sigi/apps/saberes/views.py deleted file mode 100644 index 28951f7..0000000 --- a/sigi/apps/saberes/views.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -import requests -from django.http import HttpResponse -from django.shortcuts import render -from django.views.decorators.csrf import csrf_exempt -from requests.auth import HTTPBasicAuth - -from sigi.settings import PENTAHO_SERVER, PENTAHO_DASHBOARDS, PENTAHO_USERNAME_PASSWORD - - -PENTAHO_CDF_URL = 'http://%s/pentaho/plugin/pentaho-cdf-dd/api/renderer/' % PENTAHO_SERVER - - -def get_dashboard_parts(dashboard_id, this_host): - params = PENTAHO_DASHBOARDS[dashboard_id] - params['root'] = this_host - return [requests.get(PENTAHO_CDF_URL + method, - params=params, auth=HTTPBasicAuth(*PENTAHO_USERNAME_PASSWORD)).content - for method in ('getHeaders', 'getContent')] - - -def make_dashboard(dashboard_id, adjust_content=lambda x: x): - def view(request): - headers, content = get_dashboard_parts(dashboard_id, request.META['HTTP_HOST']) - if request.is_secure: - headers = headers.replace('http://', 'https://') - content = adjust_content(content) - return render(request, 'saberes/dashboard.html', - dict(headers=headers, content=content)) - return view - - -def use_to_container_fluid(content): - return content.replace("class='container'", "class='container-fluid'") - - -dashboard = make_dashboard('saberes-geral') -cursos_sem_tutoria = make_dashboard('saberes-cursos-sem-tutoria', use_to_container_fluid) -cursos_com_tutoria = make_dashboard('saberes-cursos-com-tutoria', use_to_container_fluid) - - -@csrf_exempt -def pentaho_proxy(request, path): - url = 'http://%s/pentaho/%s' % (PENTAHO_SERVER, path) - params = request.GET or request.POST - auth = HTTPBasicAuth(*PENTAHO_USERNAME_PASSWORD) - response = requests.get(url, params=params, auth=auth) - return HttpResponse(response.content, - status=response.status_code, - content_type=response.headers.get('Content-Type')) diff --git a/sigi/apps/utils/moodle_ws_api.py b/sigi/apps/utils/moodle_ws_api.py deleted file mode 100644 index 1be0cc0..0000000 --- a/sigi/apps/utils/moodle_ws_api.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -# -# sigi.apps.utils.moodle_ws_api -# -# Copyright (C) 2015 Interlegis -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -import json -import urllib2 -from django.conf import settings - -def get_courses(ids=[], sort_order='', *args, **kwargs): - ''' Implements core_courses_get_courses function - @param ids: list of course ids to retrieve, blank for all courses - @param sort_order: String field to sort the course list. - Prefix wuth - char to indicate reverse order - @param [field_name[__function]: Filters to apply, in django-style filters. Examples: - - idnumber__startswith='evento' - - format='topics' - - visible.__ge=1 - @return: list of courses that matches with criteria - ''' - - extra_filters = [] - - for k, v in kwargs.items(): - k = k.split('__') - field = k[0] - if len(k) == 1: - k[1] == 'eq' - filter = {'field': k[0]} - if k[1] == 'eq': - filter['function'] = '__eq__' - elif k[1] == 'ge': - filter['function'] = '__ge__' - elif k[1] == 'gt': - filter['function'] = '__gt__' - elif k[1] == 'le': - filter['function'] = '__le__' - elif k[1] == 'lt': - filter['function'] = '__lt__' - elif k[1] == 'ne': - filter['function'] = '__ne__' - else: - filter['function'] = k[1] - filter['value'] = v - extra_filters.append(filter) - - params = [] - for i, id in enumerate(ids): - params.append('options[ids][%s]=%s' % (i, id)) - params = '&'.join(params) - - url = '%s/%s?wstoken=%s&wsfunction=core_course_get_courses&moodlewsrestformat=json' % ( - settings.SABERES_URL, settings.SABERES_REST_PATH, settings.SABERES_TOKEN) - - courses = json.loads(urllib2.urlopen(url, params).read()) - - if 'errorcode' in courses: - raise Exception(u"%(errorcode)s (%(exception)s): %(message)s" % courses) - - for filter in extra_filters: - courses = [c for c in courses - if getattr(c[filter['field']], filter['function'])(filter['value'])] - - if sort_order: - if sort_order[0] == '-': # Reverse order - sort_order = sort_order[1:] - courses.sort(key=lambda x: x[sort_order]) - courses.reverse() - else: - courses.sort(key=lambda x: x[sort_order]) - - return courses \ No newline at end of file diff --git a/sigi/settings/base.py b/sigi/settings/base.py index dd01141..e123cbc 100644 --- a/sigi/settings/base.py +++ b/sigi/settings/base.py @@ -38,9 +38,6 @@ TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ) -# Database routers -DATABASE_ROUTERS = ['moodlerouter.MoodleRouter', ] - # Application definition INSTALLED_APPS = ( @@ -70,10 +67,6 @@ INSTALLED_APPS = ( 'sigi.apps.eventos', 'sigi.apps.whois', - # Integração com Saberes (moodle) - 'sigi.apps.mdl', - 'sigi.apps.saberes', - # Third-party apps 'localflavor', 'reporting', @@ -181,7 +174,6 @@ LOGGING = { }, } -SABERES_REST_PATH = 'webservice/rest/server.php' OSTICKET_URL = 'https://suporte.interlegis.leg.br/scp/tickets.php?a=search&query=%s' REST_FRAMEWORK = { diff --git a/sigi/settings/dev.py b/sigi/settings/dev.py index 7bb99bc..47a8a4b 100644 --- a/sigi/settings/dev.py +++ b/sigi/settings/dev.py @@ -12,10 +12,6 @@ DATABASES = { 'PASSWORD': '123456', 'HOST': 'localhost', }, - 'moodle': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'moodle.db'), - } } # SECURITY WARNING: don't run with debug turned on in production! @@ -33,11 +29,4 @@ CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } -} - -PENTAHO_SERVER = 'http://localhost.com/pentaho/' -PENTAHO_DASHBOARDS = ('saberes',) -PENTAHO_USERNAME_PASSWORD = 'root@root' - -SABERES_URL = 'http://your-moodle-url.com' -SABERES_TOKEN = 'token-generated-by-moodle-to-access-webservice-api' +} \ No newline at end of file diff --git a/sigi/urls.py b/sigi/urls.py index 7eae6fc..8ae90e2 100644 --- a/sigi/urls.py +++ b/sigi/urls.py @@ -5,9 +5,6 @@ from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import TemplateView -from sigi.apps.saberes.views import pentaho_proxy - - admin.site.index_template = 'index.html' admin.autodiscover() @@ -20,12 +17,10 @@ urlpatterns = patterns( url(r'^diagnosticos/', include('sigi.apps.diagnosticos.urls')), url(r'^servidores/', include('sigi.apps.servidores.urls')), url(r'^servicos/', include('sigi.apps.servicos.urls')), - url(r'^saberes/', include('sigi.apps.saberes.urls')), url(r'^dashboard/', include('sigi.apps.metas.urls')), url(r'^ocorrencias/', include('sigi.apps.ocorrencias.urls')), url(r'^eventos/', include('sigi.apps.eventos.urls')), url(r'^whois/', include('sigi.apps.whois.urls')), - url(r'^pentaho/(?P(plugin|api)/.*)$', pentaho_proxy), url(r'^', include('sigi.apps.home.urls')), url(r'^', include(admin.site.urls)), From 74756c2764738b434a4516cb10bcae944c778938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 2 Mar 2021 16:50:41 -0300 Subject: [PATCH 16/69] Bug no display de gerentes --- sigi/apps/casas/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index c00b3ee..4f62949 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -354,7 +354,7 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): get_uf.admin_order_field = 'municipio__uf__nome' def get_gerentes(self, obj): - return obj.lista_gerentes + return obj.lista_gerentes() get_gerentes.short_description = _(u'Gerente Interlegis') get_gerentes.allow_tags = True From 04680d9264cb4929968a52e2ef4bb736324b6173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 24 Mar 2021 16:07:26 -0300 Subject: [PATCH 17/69] =?UTF-8?q?Mudan=C3=A7as=20no=20menu=20e=20na=20cone?= =?UTF-8?q?x=C3=A3o=20LDAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/admin.py | 36 +++++- sigi/apps/convenios/management/__init__.py | 0 .../convenios/management/commands/__init__.py | 0 .../management/commands/duracao_act.py | 43 +++++++ sigi/apps/home/templatetags/menu_conf.yaml | 58 ++++----- .../management/commands/sync_ldap.py | 114 ++++++++++++++---- 6 files changed, 196 insertions(+), 55 deletions(-) create mode 100644 sigi/apps/convenios/management/__init__.py create mode 100644 sigi/apps/convenios/management/commands/__init__.py create mode 100644 sigi/apps/convenios/management/commands/duracao_act.py diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 8b42c64..f199c9a 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -41,7 +41,8 @@ class ConvenioAdmin(BaseModelAdmin): change_list_template = 'convenios/change_list.html' fieldsets = ( (None, - {'fields': ('casa_legislativa', 'num_processo_sf', 'num_convenio', 'projeto', 'observacao')} + {'fields': ('casa_legislativa', 'num_processo_sf', 'num_convenio', + 'projeto', 'observacao')} ), (_(u'Datas'), {'fields': ('data_adesao', 'data_retorno_assinatura', 'duracao', @@ -55,11 +56,12 @@ class ConvenioAdmin(BaseModelAdmin): actions = ['adicionar_convenios'] inlines = (TramitacaoInline, AnexosInline, EquipamentoPrevistoInline) list_display = ('num_convenio', 'casa_legislativa', 'get_uf', - 'data_adesao', 'data_retorno_assinatura', 'data_pub_diario', 'data_termo_aceite', - 'projeto', + 'status_convenio', 'link_sigad', 'data_adesao', + 'data_retorno_assinatura', 'duracao', 'data_pub_diario', + 'data_termo_aceite', 'projeto', ) list_display_links = ('num_convenio', 'casa_legislativa',) - list_filter = ('projeto', 'casa_legislativa__tipo', 'conveniada', 'equipada', 'casa_legislativa__municipio__uf', ) + list_filter = ('projeto', 'casa_legislativa__tipo', 'conveniada','equipada', 'casa_legislativa__municipio__uf', ) #date_hierarchy = 'data_adesao' ordering = ('casa_legislativa__tipo__sigla', 'casa_legislativa__municipio__uf', 'casa_legislativa') raw_id_fields = ('casa_legislativa',) @@ -72,6 +74,32 @@ class ConvenioAdmin(BaseModelAdmin): get_uf.short_description = _(u'UF') get_uf.admin_order_field = 'casa_legislativa__municipio__uf__sigla' + def status_convenio(self, obj): + if obj.pk is None: + return "" + status = obj.get_status() + + if status in [u"Vencido", u"Desistência"]: + label = r"danger" + elif status == u"Vigente": + label = r"success" + elif status == u"Pendente": + label = r"warning" + else: + label = r"info" + + return u'

    {status}

    '.format(label=label, status=status) + status_convenio.short_description = _(u"Status do convênio") + status_convenio.allow_tags = True + + def link_sigad(self, obj): + if obj.pk is None: + return "" + return obj.get_sigad_url() + + link_sigad.short_description = _("Processo no Senado") + link_sigad.allow_tags = True + def changelist_view(self, request, extra_context=None): import re request.GET._mutable = True diff --git a/sigi/apps/convenios/management/__init__.py b/sigi/apps/convenios/management/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sigi/apps/convenios/management/commands/__init__.py b/sigi/apps/convenios/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sigi/apps/convenios/management/commands/duracao_act.py b/sigi/apps/convenios/management/commands/duracao_act.py new file mode 100644 index 0000000..2144582 --- /dev/null +++ b/sigi/apps/convenios/management/commands/duracao_act.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# +# sigi.apps.casas.management.commands.importa_gerentes +# +# Copyright (c) 2015 by Interlegis +# +# GNU General Public License (GPL) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +# + +from django.core.management.base import BaseCommand, CommandError +from sigi.apps.convenios.models import Projeto, Convenio + +class Command(BaseCommand): + help = u"""Define a duração de todos os ACT para 60 meses. + * A sigla do Projeto precisa ser ACT; + * O campo duracao precisa estar em branco. + """ + + def handle(self, *args, **options): + self.stdout.write(u"Atualizando ACTs... ") + act = Projeto.objects.get(sigla='ACT') + for conv in Convenio.objects.filter(projeto=act, duracao=None): + conv.duracao = 60 + conv.save() + self.stdout.write(u"\tACT {sigad} da Casa {casa} atualizado".format( + sigad=conv.num_processo_sf, casa=conv.casa_legislativa.nome + )) + self.stdout.write(u"Pronto!") diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 0388ff7..ec7dcb7 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -34,15 +34,15 @@ main_menu: url: parlamentares/cargo/ - title: Tabela de partidos url: parlamentares/partido/ - - title: Diagnósticos - url: diagnosticos/diagnostico/ - children: - - title: Administração - url: diagnosticos/diagnostico/ - - title: Coleta de dados - url: diagnosticos/mobile/ - - title: Gráficos e estatísticas - url: diagnosticos/graficos + # - title: Diagnósticos + # url: diagnosticos/diagnostico/ + # children: + # - title: Administração + # url: diagnosticos/diagnostico/ + # - title: Coleta de dados + # url: diagnosticos/mobile/ + # - title: Gráficos e estatísticas + # url: diagnosticos/graficos - title: Convênios url: convenios/convenio/ children: @@ -50,21 +50,21 @@ main_menu: url: convenios/convenio/ - title: Planos diretores url: metas/planodiretor/ - - title: Inventário - url: inventario/bem/ - children: - - title: Bens - url: inventario/bem/ - - title: Fornecedores - url: inventario/fornecedor/ - - title: Equipamentos - url: inventario/equipamento/ - - title: Fabricantes - url: inventario/fabricante/ - - title: Tipos de equipamentos - url: inventario/tipoequipamento/ - - title: Modelos de equipamentos - url: inventario/modeloequipamento/ + # - title: Inventário + # url: inventario/bem/ + # children: + # - title: Bens + # url: inventario/bem/ + # - title: Fornecedores + # url: inventario/fornecedor/ + # - title: Equipamentos + # url: inventario/equipamento/ + # - title: Fabricantes + # url: inventario/fabricante/ + # - title: Tipos de equipamentos + # url: inventario/tipoequipamento/ + # - title: Modelos de equipamentos + # url: inventario/modeloequipamento/ - title: Servidores url: servidores/servidor/?user__is_active__exact=1 children: @@ -109,8 +109,8 @@ main_menu: url: eventos/tipoevento/ - title: Funções na equipe url: eventos/funcao/ - - title: Financeiro - url: financeiro/desembolso/ - children: - - title: Desembolsos - url: financeiro/desembolso/ \ No newline at end of file + # - title: Financeiro + # url: financeiro/desembolso/ + # children: + # - title: Desembolsos + # url: financeiro/desembolso/ \ No newline at end of file diff --git a/sigi/apps/servidores/management/commands/sync_ldap.py b/sigi/apps/servidores/management/commands/sync_ldap.py index 6c2c9c3..530d8a6 100644 --- a/sigi/apps/servidores/management/commands/sync_ldap.py +++ b/sigi/apps/servidores/management/commands/sync_ldap.py @@ -18,26 +18,95 @@ class Command(BaseCommand): filter = "(&(objectclass=Group))" values = ['cn', ] l = ldap.initialize(AUTH_LDAP_SERVER_URI) - l.protocol_version = ldap.VERSION3 - l.simple_bind_s(AUTH_LDAP_BIND_DN.encode('utf-8'), AUTH_LDAP_BIND_PASSWORD) - result_id = l.search(AUTH_LDAP_GROUP, ldap.SCOPE_SUBTREE, filter, values) - result_type, result_data = l.result(result_id, 1) - l.unbind() - return result_data + try: + l.protocol_version = ldap.VERSION3 + l.set_option(ldap.OPT_REFERRALS, 0) + l.simple_bind_s(AUTH_LDAP_BIND_DN.encode('utf-8'), + AUTH_LDAP_BIND_PASSWORD) + + page_control = ldap.controls.SimplePagedResultsControl( + True, + size=1000, + cookie='' + ) + result = [] + pages = 0 + + while True: + pages += 1 + response = l.search_ext( + AUTH_LDAP_GROUP, + ldap.SCOPE_SUBTREE, + filter, + values, + serverctrls=[page_control] + ) + rtype, rdata, rmsgid, serverctrls = l.result3(response) + result.extend(rdata) + controls = [control for control in serverctrls + if control.controlType == + ldap.controls.SimplePagedResultsControl.controlType] + if not controls: + raise Exception('The server ignores RFC 2696 control') + if not controls[0].cookie: + break + page_control.cookie = controls[0].cookie + # result_id = l.search(AUTH_LDAP_GROUP, ldap.SCOPE_SUBTREE, filter, values) + # result_type, result_data = l.result(result_id, 1) + finally: + l.unbind() + return result def get_ldap_users(self): - filter = "(&(objectclass=user))" + filter = "(&(objectclass=user)(memberof=CN=ILB,OU=Grupos,DC=senado,DC=gov,DC=br))" values = ['sAMAccountName', 'userPrincipalName', 'givenName', 'sn', 'cn'] l = ldap.initialize(AUTH_LDAP_SERVER_URI) - l.protocol_version = ldap.VERSION3 - l.simple_bind_s(AUTH_LDAP_BIND_DN.encode('utf-8'), AUTH_LDAP_BIND_PASSWORD) - result_id = l.search(AUTH_LDAP_USER.encode('utf-8'), ldap.SCOPE_SUBTREE, filter, values) - result_type, result_data = l.result(result_id, 1) - l.unbind() - return result_data + try: + l.protocol_version = ldap.VERSION3 + l.set_option(ldap.OPT_REFERRALS, 0) + l.simple_bind_s( + AUTH_LDAP_BIND_DN.encode('utf-8'), + AUTH_LDAP_BIND_PASSWORD + ) + + page_control = ldap.controls.SimplePagedResultsControl( + True, + size=1000, + cookie='' + ) + + result = [] + pages = 0 + + while True: + pages += 1 + response = l.search_ext( + AUTH_LDAP_USER.encode('utf-8'), + ldap.SCOPE_SUBTREE, + filter, + values, + serverctrls=[page_control] + ) + rtype, rdata, rmsgid, serverctrls = l.result3(response) + result.extend(rdata) + controls = [control for control in serverctrls + if control.controlType == + ldap.controls.SimplePagedResultsControl.controlType] + if not controls: + raise Exception('The server ignores RFC 2696 control') + if not controls[0].cookie: + break + page_control.cookie = controls[0].cookie + # result_id = l.search(AUTH_LDAP_USER.encode('utf-8'), ldap.SCOPE_SUBTREE, filter, values) + # result_type, result_data = l.result(result_id, 1) + finally: + l.unbind() + return result def sync_groups(self): + print "Syncing groups..." ldap_groups = self.get_ldap_groups() + print "\tFetched groups: %s" % len(ldap_groups) for ldap_group in ldap_groups: try: group_name = ldap_group[1]['cn'][0] @@ -49,12 +118,13 @@ class Command(BaseCommand): except Group.DoesNotExist: group = Group(name=group_name) group.save() - print "Group '%s' created." % group_name + print "\tGroup '%s' created." % group_name print "Groups are synchronized." def sync_users(self): + print "Syncing users..." ldap_users = self.get_ldap_users() - + print "\tFetched users: %s" % len(ldap_users) def get_ldap_property(ldap_user, property_name, default_value=None): value = ldap_user[1].get(property_name, None) return value[0].decode('utf8') if value else default_value @@ -72,7 +142,7 @@ class Command(BaseCommand): user = User.objects.get(email=email) old_username = user.username user.username = username - print "User with email '%s' had his/her username updated from [%s] to [%s]." % ( + print "\tUser with email '%s' had his/her username updated from [%s] to [%s]." % ( email, old_username, username) except User.DoesNotExist: user = User.objects.create_user( @@ -81,17 +151,17 @@ class Command(BaseCommand): last_name=last_name, email=email, ) - print "User '%s' created." % username + print "\tUser '%s' created." % username if not user.first_name == first_name: user.first_name = first_name - print "User '%s' first name updated." % username + print "\tUser '%s' first name updated." % username if not user.last_name == last_name: user.last_name = last_name - print "User '%s' last name updated." % username + print "\tUser '%s' last name updated." % username if not user.email == email: user.email = email - print "User '%s' email updated." % username + print "\tUser '%s' email updated." % username nome_completo = get_ldap_property(ldap_user, 'cn', '') try: @@ -101,11 +171,11 @@ class Command(BaseCommand): servidor = Servidor.objects.get(nome_completo=nome_completo) except Servidor.DoesNotExist: servidor = user.servidor_set.create(nome_completo=nome_completo) - print "Servidor '%s' created." % nome_completo + print "\tServidor '%s' created." % nome_completo else: if not servidor.nome_completo == nome_completo: servidor.nome_completo = nome_completo - print "Full name of Servidor '%s' updated." % nome_completo + print "\tFull name of Servidor '%s' updated." % nome_completo servidor.user = user servidor.save() From d8c8dee86805aae63b2b790476e5d2c9558f194d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 24 Mar 2021 16:42:47 -0300 Subject: [PATCH 18/69] =?UTF-8?q?Ajuste=20no=20scipt=20de=20sincroniza?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20LDAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/servidores/management/commands/sync_ldap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigi/apps/servidores/management/commands/sync_ldap.py b/sigi/apps/servidores/management/commands/sync_ldap.py index 530d8a6..3adf186 100644 --- a/sigi/apps/servidores/management/commands/sync_ldap.py +++ b/sigi/apps/servidores/management/commands/sync_ldap.py @@ -58,7 +58,7 @@ class Command(BaseCommand): return result def get_ldap_users(self): - filter = "(&(objectclass=user)(memberof=CN=ILB,OU=Grupos,DC=senado,DC=gov,DC=br))" + filter = "(&(objectclass=user)(|(memberof=CN=lgs_ilb,OU=GruposAutomaticosOU,DC=senado,DC=gov,DC=br)(memberof=CN=lgt_ilb,OU=GruposAutomaticosOU,DC=senado,DC=gov,DC=br)(memberof=CN=lge_ilb,OU=GruposAutomaticosOU,DC=senado,DC=gov,DC=br)))" values = ['sAMAccountName', 'userPrincipalName', 'givenName', 'sn', 'cn'] l = ldap.initialize(AUTH_LDAP_SERVER_URI) try: From 50d1afc7c8779a6f118b19b5739cdc9863bd6b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 29 Mar 2021 18:18:35 -0300 Subject: [PATCH 19/69] Permitir municipio em branco no contato --- sigi/apps/casas/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 9b16b4c..ab51ae4 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -365,7 +365,8 @@ class Funcionario(models.Model): municipio = models.ForeignKey( Municipio, verbose_name=_(u'Municipio'), - null=True + null=True, + blank=True, ) bairro = models.CharField(_(u'Bairro'), max_length=100, blank=True) cep = models.CharField(_(u'CEP'), max_length=10, blank=True) From 60c8c28ee10de83f7894e82e08a10fccb7a1e57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 30 Mar 2021 13:51:47 -0300 Subject: [PATCH 20/69] Fixes #15 --- sigi/apps/casas/admin.py | 15 +- .../casas/convenios_inline.html} | 6 +- .../admin/casas/ocorrencia_inline.html | 164 ++++++++++++++++++ 3 files changed, 175 insertions(+), 10 deletions(-) rename sigi/apps/casas/templates/{casas/ocorrencia_inline.html => admin/casas/convenios_inline.html} (96%) create mode 100644 sigi/apps/casas/templates/admin/casas/ocorrencia_inline.html diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 4f62949..a8c5fa8 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -90,6 +90,7 @@ class ConveniosInline(admin.TabularInline): ('data_adesao', 'data_retorno_assinatura', 'data_termo_aceite', 'data_pub_diario', 'data_devolucao_via', 'data_postagem_correio'), ('data_devolucao_sem_assinatura', 'data_retorno_sem_assinatura',), + ('get_anexos',), ('link_convenio',), )}), ) @@ -98,9 +99,10 @@ class ConveniosInline(admin.TabularInline): 'data_retorno_assinatura', 'data_termo_aceite', 'data_pub_diario', 'data_devolucao_via', 'data_postagem_correio', 'data_devolucao_sem_assinatura', - 'data_retorno_sem_assinatura',] + 'data_retorno_sem_assinatura', 'get_anexos'] extra = 0 can_delete = False + template = 'admin/casas/convenios_inline.html' def has_add_permission(self, request): return False @@ -111,11 +113,10 @@ class ConveniosInline(admin.TabularInline): # get_tramitacoes.short_description = _(u'Tramitações') # get_tramitacoes.allow_tags = True # -# def get_anexos(self, obj): -# return '
    '.join(['%s' % (a.arquivo.url, a.__unicode__()) for a in obj.anexo_set.all()]) -# -# get_anexos.short_description = _(u'Anexos') -# get_anexos.allow_tags = True + def get_anexos(self, obj): + return '
    '.join(['%s' % (a.arquivo.url, a.__unicode__()) for a in obj.anexo_set.all()]) + get_anexos.short_description = _(u'Anexos') + get_anexos.allow_tags = True # # def get_equipamentos(self, obj): # return '
    '.join([e.__unicode__() for e in obj.equipamentoprevisto_set.all()]) @@ -229,7 +230,7 @@ class OcorrenciaInline(admin.TabularInline): extra = 0 max_num = 0 can_delete = False - template = 'casas/ocorrencia_inline.html' + template = 'admin/casas/ocorrencia_inline.html' def link_editar(self, obj): if obj.pk is None: diff --git a/sigi/apps/casas/templates/casas/ocorrencia_inline.html b/sigi/apps/casas/templates/admin/casas/convenios_inline.html similarity index 96% rename from sigi/apps/casas/templates/casas/ocorrencia_inline.html rename to sigi/apps/casas/templates/admin/casas/convenios_inline.html index 6901891..9b9a86f 100644 --- a/sigi/apps/casas/templates/casas/ocorrencia_inline.html +++ b/sigi/apps/casas/templates/admin/casas/convenios_inline.html @@ -65,9 +65,9 @@ {% endif %} {% endfor %} - - - Adicionar ocorrência + + + {% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %} diff --git a/sigi/apps/casas/templates/admin/casas/ocorrencia_inline.html b/sigi/apps/casas/templates/admin/casas/ocorrencia_inline.html new file mode 100644 index 0000000..2103f2a --- /dev/null +++ b/sigi/apps/casas/templates/admin/casas/ocorrencia_inline.html @@ -0,0 +1,164 @@ +{% load i18n admin_static admin_modify bootstrapped_goodies_tags %} +
    + +
    + + From 35197ad24d23c7bf4a94212b3c1da38656e45d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 11:25:08 -0300 Subject: [PATCH 21/69] =?UTF-8?q?Remo=C3=A7=C3=A3o=20de=20apps=20do=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/home/templatetags/menu_conf.yaml | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index ec7dcb7..c14c275 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -23,17 +23,17 @@ main_menu: url: casas/carteira - title: Tipos de Casas url: casas/tipocasalegislativa/ - - title: Legislaturas - url: parlamentares/legislatura/ - children: - - title: Todas - url: parlamentares/legislatura/ - - title: Parlamentares - url: parlamentares/parlamentar/ - - title: Tabela de cargos - url: parlamentares/cargo/ - - title: Tabela de partidos - url: parlamentares/partido/ + # - title: Legislaturas + # url: parlamentares/legislatura/ + # children: + # - title: Todas + # url: parlamentares/legislatura/ + # - title: Parlamentares + # url: parlamentares/parlamentar/ + # - title: Tabela de cargos + # url: parlamentares/cargo/ + # - title: Tabela de partidos + # url: parlamentares/partido/ # - title: Diagnósticos # url: diagnosticos/diagnostico/ # children: @@ -65,17 +65,17 @@ main_menu: # url: inventario/tipoequipamento/ # - title: Modelos de equipamentos # url: inventario/modeloequipamento/ - - title: Servidores - url: servidores/servidor/?user__is_active__exact=1 - children: - - title: Pessoal - url: servidores/servidor/?user__is_active__exact=1 - - title: Funções - url: servidores/funcao - - title: Férias - url: servidores/ferias/ - - title: Licenças - url: servidores/licenca/ + # - title: Servidores + # url: servidores/servidor/?user__is_active__exact=1 + # children: + # - title: Pessoal + # url: servidores/servidor/?user__is_active__exact=1 + # - title: Funções + # url: servidores/funcao + # - title: Férias + # url: servidores/ferias/ + # - title: Licenças + # url: servidores/licenca/ - title: Serviços SEIT url: servicos/casaatendida/ children: From aa0bff99134da2debb6e50cb1c41699e88fb1238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 12:59:11 -0300 Subject: [PATCH 22/69] =?UTF-8?q?Permitir=20brancos=20no=20municipio=20de?= =?UTF-8?q?=20resid=C3=AAncia=20do=20contato?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0009_auto_20210406_1055.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sigi/apps/casas/migrations/0009_auto_20210406_1055.py diff --git a/sigi/apps/casas/migrations/0009_auto_20210406_1055.py b/sigi/apps/casas/migrations/0009_auto_20210406_1055.py new file mode 100644 index 0000000..e1b1c5e --- /dev/null +++ b/sigi/apps/casas/migrations/0009_auto_20210406_1055.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0008_auto_20210218_1007'), + ] + + operations = [ + migrations.AlterField( + model_name='funcionario', + name='municipio', + field=models.ForeignKey(verbose_name='Municipio', blank=True, to='contatos.Municipio', null=True), + preserve_default=True, + ), + ] From 05d3cc8816344fce652822d787e2b5c2417a78df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 13:15:57 -0300 Subject: [PATCH 23/69] Altera TipoCasaLegislativa para TipoOrgao --- etc/migracao/migra.py | 14 +++---- sigi/apps/casas/admin.py | 4 +- sigi/apps/casas/models.py | 4 +- sigi/apps/casas/views.py | 84 +++++++++++++++++++-------------------- 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/etc/migracao/migra.py b/etc/migracao/migra.py index 47216db..dc0cfff 100755 --- a/etc/migracao/migra.py +++ b/etc/migracao/migra.py @@ -60,7 +60,7 @@ def migra_assembleias(filename): reader = csv.reader(open(filename, 'r'), delimiter='|', skipinitialspace=True) header = reader.next() - tipo_casa = TipoCasaLegislativa.objects.filter(sigla='AL').get() + tipo_casa = TipoOrgao.objects.filter(sigla='AL').get() for line in reader: uf = UnidadeFederativa.objects.get(sigla=line[UF_COL]) @@ -85,7 +85,7 @@ def migra_assembleias(filename): telefone=line[FONE_1_COL] ) if line[UF_COL] == 'DF': - casa.tipo = TipoCasaLegislativa.objects.filter(sigla='CT').get() + casa.tipo = TipoOrgao.objects.filter(sigla='CT').get() casa.save() if line[FONE_2_COL]: @@ -141,7 +141,7 @@ def migra_casas(filename): reader = csv.reader(open(filename, 'r'), delimiter='|', skipinitialspace=True) header = reader.next() - tipo_casa = TipoCasaLegislativa.objects.filter(sigla='CM').get() + tipo_casa = TipoOrgao.objects.filter(sigla='CM').get() linenum = 1 for line in reader: @@ -368,7 +368,7 @@ def migra_convenios_assembleias(filename): reader = csv.reader(open(filename, 'r'), delimiter='|', skipinitialspace=True) header = reader.next() linenum = 1 - tipo_casa = TipoCasaLegislativa.objects.filter(sigla='AL').get() + tipo_casa = TipoOrgao.objects.filter(sigla='AL').get() for line in reader: linenum += 1 @@ -417,11 +417,11 @@ def popula(): projeto3 = Projeto(sigla='PML', nome='Projeto Modernização Legislativo') projeto3.save() - tipo1 = TipoCasaLegislativa(sigla='CM', nome='Câmara Municipal') + tipo1 = TipoOrgao(sigla='CM', nome='Câmara Municipal') tipo1.save() - tipo2 = TipoCasaLegislativa(sigla='AL', nome='Assembléia Legislativa') + tipo2 = TipoOrgao(sigla='AL', nome='Assembléia Legislativa') tipo2.save() - tipo3 = TipoCasaLegislativa(sigla='CT', nome='Câmara Distrital') + tipo3 = TipoOrgao(sigla='CT', nome='Câmara Distrital') tipo3.save() diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index a8c5fa8..ed511d9 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -9,7 +9,7 @@ from django.utils.translation import ugettext as _ from image_cropping import ImageCroppingMixin from sigi.apps.casas.forms import CasaLegislativaForm -from sigi.apps.casas.models import CasaLegislativa, Presidente, Funcionario, TipoCasaLegislativa +from sigi.apps.casas.models import CasaLegislativa, Presidente, Funcionario, TipoOrgao from sigi.apps.casas.views import report_complete, labels_report, export_csv, \ labels_report_sem_presidente, report, \ adicionar_casas_carrinho @@ -433,4 +433,4 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): admin.site.register(CasaLegislativa, CasaLegislativaAdmin) -admin.site.register(TipoCasaLegislativa) +admin.site.register(TipoOrgao) diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index ab51ae4..14e4cac 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -13,7 +13,7 @@ from sigi.apps.servidores.models import Servidor from sigi.apps.utils import SearchField -class TipoCasaLegislativa(models.Model): +class TipoOrgao(models.Model): """ Modelo para representar o tipo da Casa Legislativa @@ -49,7 +49,7 @@ class CasaLegislativa(models.Model): # Guarda um campo para ser usado em buscas em caixa baixa e sem acento search_text = SearchField(field_names=['nome']) # search_text.projeto_filter = True - tipo = models.ForeignKey(TipoCasaLegislativa, verbose_name=_(u"Tipo")) + tipo = models.ForeignKey(TipoOrgao, verbose_name=_(u"Tipo")) cnpj = models.CharField(_(u"CNPJ"), max_length=32, blank=True) observacoes = models.TextField(_(u'observações'), blank=True) horario_funcionamento = models.CharField( diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 18bd0f5..9b431e3 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -11,7 +11,7 @@ from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _, ungettext from sigi.apps.casas.forms import PortfolioForm -from sigi.apps.casas.models import CasaLegislativa, TipoCasaLegislativa +from sigi.apps.casas.models import CasaLegislativa, TipoOrgao from sigi.apps.casas.reports import (CasasLegislativasLabels, CasasLegislativasLabelsSemPresidente) from sigi.apps.contatos.models import UnidadeFederativa, Mesorregiao, Microrregiao @@ -49,18 +49,18 @@ def get_for_qs(get, qs): for k, v in get.iteritems(): if str(k) not in ('page', 'pop', 'q', '_popup', 'o', 'ot'): kwargs[str(k)] = v - + if 'convenio' in kwargs: if kwargs['convenio'] == 'SC': - qs = qs.filter(convenio=None) + qs = qs.filter(convenio=None) elif kwargs['convenio'] == 'CC': qs = qs.exclude(convenio=None) else: qs = qs.filter(convenio__projeto_id=kwargs['convenio']) - + qs = qs.distinct('municipio__uf__nome', 'nome') del(kwargs['convenio']) - + if 'servico' in kwargs: if kwargs['servico'] == 'SS': qs = qs.filter(servico=None) @@ -79,9 +79,9 @@ def get_for_qs(get, qs): qs = qs.filter(servico__tipo_servico_id=kwargs['servico']) qs = qs.distinct('municipio__uf__nome', 'nome') - + del(kwargs['servico']) - + qs = qs.filter(**kwargs) if 'o' in get: qs = query_ordena(qs, get['o']) @@ -291,10 +291,10 @@ def report(request, id=None, tipo=None): if not qs: return HttpResponseRedirect('../') - + qs = qs.order_by('municipio__uf', 'nome') context = {'casas': qs, 'title': _(u"Relação de Casas Legislativas")} - + return render_to_pdf('casas/report_pdf.html', context) @@ -308,7 +308,7 @@ def report_complete(request, id=None): if not qs: return HttpResponseRedirect('../') - + return render_to_pdf('casas/report_complete_pdf.html', {'casas': qs}) @@ -323,7 +323,7 @@ def casas_sem_convenio_report(request): qs = qs.order_by('municipio__uf', 'nome') context = {'casas': qs, 'title': _(u"Casas sem convênio")} - + return render_to_pdf('casas/report_pdf.html', context) @@ -426,21 +426,21 @@ def portfolio(request): uf_id = request.GET.get('uf', None) meso_id = request.GET.get('meso', None) micro_id = request.GET.get('micro', None) - + data = {} data['errors'] = [] data['messages'] = [] data['regioes'] = UnidadeFederativa.REGIAO_CHOICES - data['tipos_casas'] = TipoCasaLegislativa.objects.all() + data['tipos_casas'] = TipoOrgao.objects.all() casas = None gerente = None - + if tipo: data['tipo'] = tipo - + if micro_id: microrregiao = get_object_or_404(Microrregiao, pk=micro_id) - mesorregiao = microrregiao.mesorregiao + mesorregiao = microrregiao.mesorregiao uf = mesorregiao.uf data['regiao'] = uf.regiao data['uf_id'] = uf.pk @@ -489,25 +489,25 @@ def portfolio(request): data['ufs'] = UnidadeFederativa.objects.filter(regiao=regiao) data['form'] = PortfolioForm( _(u'Atribuir casas da região {name} para').format( - name=[x[1] for x in UnidadeFederativa.REGIAO_CHOICES if + name=[x[1] for x in UnidadeFederativa.REGIAO_CHOICES if x[0] == regiao][0])) data['querystring'] = 'regiao={0}'.format(regiao) casas = CasaLegislativa.objects.filter(municipio__uf__regiao=regiao) if casas: - casas = casas.order_by('municipio__uf', + casas = casas.order_by('municipio__uf', 'municipio__microrregiao__mesorregiao', 'municipio__microrregiao', 'municipio') - + casas.prefetch_related('municipio', 'municipio__uf', 'municipio__microrregiao', 'municipio__microrregiao__mesorregiao', 'gerentes_interlegis') - + if tipo: casas = casas.filter(tipo__sigla=tipo) data['querystring'] += "&tipo={0}".format(tipo) - + if request.method == 'POST': form = PortfolioForm(data=request.POST) if form.is_valid(): @@ -515,7 +515,7 @@ def portfolio(request): acao = form.cleaned_data['acao'] count = casas.count() - + if acao == 'ADD': gerente.casas_que_gerencia.add(*casas) data['messages'].append(ungettext( @@ -534,14 +534,14 @@ def portfolio(request): data['errors'].append(_(u"Ação não definida")) else: data['errors'].append(_(u"Dados inválidos")) - + paginator = Paginator(casas, 30) try: pagina = paginator.page(page) except (EmptyPage, InvalidPage): pagina = paginator.page(paginator.num_pages) data['page_obj'] = pagina - + return render(request, 'casas/portfolio.html', data) @@ -552,13 +552,13 @@ def resumo_carteira(casas): sem_produto = regioes.copy() tipos_servico = TipoServico.objects.all() dados = {ts.id: regioes.copy() for ts in tipos_servico} - + for r in casas.values('municipio__uf__regiao').annotate(quantidade=Count('id')).order_by(): regiao = r['municipio__uf__regiao'] quantidade = r['quantidade'] total[regiao] = quantidade total['total'] += quantidade - + for r in casas.values('municipio__uf__regiao', 'servico__tipo_servico__id').annotate(quantidade=Count('id')).order_by(): regiao = r['municipio__uf__regiao'] servico = r['servico__tipo_servico__id'] @@ -567,16 +567,16 @@ def resumo_carteira(casas): sem_produto[regiao] = quantidade sem_produto['total'] += quantidade else: - dados[servico][regiao] = quantidade + dados[servico][regiao] = quantidade dados[servico]['total'] += quantidade - + dados_ocorrencia = { 'registradas': regioes.copy(), 'pendentes': regioes.copy(), 'sem': regioes.copy(), 'media': regioes.copy(), } - + for r in casas.values('ocorrencia__status', 'municipio__uf__regiao').annotate(quantidade=Count('id')).order_by(): status = r['ocorrencia__status'] regiao = r['municipio__uf__regiao'] @@ -590,13 +590,13 @@ def resumo_carteira(casas): if status in [Ocorrencia.STATUS_ABERTO, Ocorrencia.STATUS_REABERTO]: dados_ocorrencia['pendentes'][regiao] += quantidade dados_ocorrencia['pendentes']['total'] += quantidade - + for r in regioes: if (total[r] - dados_ocorrencia['sem'][r]) == 0: dados_ocorrencia['media'][r] = 0 else: dados_ocorrencia['media'][r] = (1.0 * dados_ocorrencia['registradas'][r] / (total[r] - dados_ocorrencia['sem'][r])) - + resumo = [[_(u"Item"), _(u"Total nacional")] + [r[1] for r in UnidadeFederativa.REGIAO_CHOICES]] resumo.append([_(u"Casas em sua carteira"), total['total']] + [total[r[0]] for r in UnidadeFederativa.REGIAO_CHOICES]) resumo.append({'subtitle': _(u"Uso dos produtos Interlegis")}) @@ -619,7 +619,7 @@ def casas_carteira(request, casas, context): micro_id = request.GET.get('micro', None) servicos = request.GET.getlist('servico') tipos_servico = context['servicos'] - + context['qs_regiao'] = '' if micro_id is not None: @@ -644,12 +644,12 @@ def casas_carteira(request, casas, context): context['regiao'] = sigla_regiao context['qs_regiao'] = 'r=%s' % sigla_regiao casas = casas.filter(municipio__uf__regiao=sigla_regiao) - + if 'regiao' in context: context['ufs'] = UnidadeFederativa.objects.filter(regiao=context['regiao']) - + todos_servicos = ['_none_'] + [s.sigla for s in tipos_servico] - + if not servicos or set(servicos) == set(todos_servicos): servicos = todos_servicos context['qs_servico'] = '' @@ -660,9 +660,9 @@ def casas_carteira(request, casas, context): casas = casas.filter(servico__tipo_servico__sigla__in=servicos) casas = casas.distinct('nome', 'municipio__uf') context['qs_servico'] = "&".join(['servico=%s' % s for s in servicos]) - + context['servicos_check'] = servicos - + casas = casas.select_related('municipio', 'municipio__uf', 'municipio__microrregiao', 'municipio__microrregiao__mesorregiao').prefetch_related('servico_set') return casas, context @@ -675,7 +675,7 @@ def painel_relacionamento(request): seletor = request.GET.get('s', None) servidor = request.GET.get('servidor', None) fmt = request.GET.get('f', 'html') - + if servidor is None: gerente = request.user.servidor elif servidor == '_all': @@ -689,7 +689,7 @@ def painel_relacionamento(request): if gerente is None or not casas.exists(): casas = CasaLegislativa.objects.exclude(gerentes_interlegis=None) gerente = None - + tipos_servico = TipoServico.objects.all() regioes = UnidadeFederativa.REGIAO_CHOICES @@ -702,11 +702,11 @@ def painel_relacionamento(request): 'gerente': gerente, 'qs_servidor': ('servidor=%s' % gerente.pk) if gerente else '', } - + if snippet != 'lista': context['resumo'] = resumo_carteira(casas) - if snippet != 'resumo': + if snippet != 'resumo': casas, context = casas_carteira(request, casas, context) paginator = Paginator(casas, 30) try: @@ -743,5 +743,5 @@ def painel_relacionamento(request): return render(request, 'casas/lista_casas_carteira_snippet.html', context) if snippet == 'resumo': return render(request, 'casas/resumo_carteira_snippet.html', context) - + return render(request, 'casas/painel.html', context) From fe5ade55b4086db29fe0f299d9aae0d17a8a4904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 13:36:06 -0300 Subject: [PATCH 24/69] =?UTF-8?q?Complementos=20migra=C3=A7=C3=A3o=20TipoC?= =?UTF-8?q?asaLegislativa=20>=20TipoOrgao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0010_auto_20210406_1101.py | 18 ++++++++++++++++++ .../migrations/0011_auto_20210406_1135.py | 18 ++++++++++++++++++ sigi/apps/home/templatetags/menu_conf.yaml | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 sigi/apps/casas/migrations/0010_auto_20210406_1101.py create mode 100644 sigi/apps/casas/migrations/0011_auto_20210406_1135.py diff --git a/sigi/apps/casas/migrations/0010_auto_20210406_1101.py b/sigi/apps/casas/migrations/0010_auto_20210406_1101.py new file mode 100644 index 0000000..dfc8436 --- /dev/null +++ b/sigi/apps/casas/migrations/0010_auto_20210406_1101.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0009_auto_20210406_1055'), + ] + + operations = [ + migrations.RenameModel( + old_name='TipoCasaLegislativa', + new_name='TipoOrgao', + ), + ] diff --git a/sigi/apps/casas/migrations/0011_auto_20210406_1135.py b/sigi/apps/casas/migrations/0011_auto_20210406_1135.py new file mode 100644 index 0000000..276d3bb --- /dev/null +++ b/sigi/apps/casas/migrations/0011_auto_20210406_1135.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0010_auto_20210406_1101'), + ] + + operations = [ + migrations.AlterModelOptions( + name='tipoorgao', + options={'verbose_name': 'Tipo de \xf3rg\xe3o', 'verbose_name_plural': 'Tipos de \xf3rg\xe3o'}, + ), + ] diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index c14c275..3283527 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -22,7 +22,7 @@ main_menu: - title: Carteira de relacionamentos url: casas/carteira - title: Tipos de Casas - url: casas/tipocasalegislativa/ + url: casas/tipoorgao/ # - title: Legislaturas # url: parlamentares/legislatura/ # children: From c83382173eb474822594ab95d46ac1fb8a841d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 16:21:49 -0300 Subject: [PATCH 25/69] =?UTF-8?q?Altera=C3=A7=C3=A3o=20verbose=5Fname=20de?= =?UTF-8?q?=20TipoOrgao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0012_auto_20210406_1420.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sigi/apps/casas/migrations/0012_auto_20210406_1420.py diff --git a/sigi/apps/casas/migrations/0012_auto_20210406_1420.py b/sigi/apps/casas/migrations/0012_auto_20210406_1420.py new file mode 100644 index 0000000..1e237c2 --- /dev/null +++ b/sigi/apps/casas/migrations/0012_auto_20210406_1420.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0011_auto_20210406_1135'), + ] + + operations = [ + migrations.AlterModelOptions( + name='tipoorgao', + options={}, + ), + ] From 59ead54e5629da63d35a62a3462ad8016cee7b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 16:33:12 -0300 Subject: [PATCH 26/69] Verbose_name de Orgao --- .../migrations/0013_auto_20210406_1428.py | 18 ++++++++++++++++++ sigi/apps/casas/models.py | 4 ++++ sigi/apps/home/templatetags/menu_conf.yaml | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sigi/apps/casas/migrations/0013_auto_20210406_1428.py diff --git a/sigi/apps/casas/migrations/0013_auto_20210406_1428.py b/sigi/apps/casas/migrations/0013_auto_20210406_1428.py new file mode 100644 index 0000000..4b1851d --- /dev/null +++ b/sigi/apps/casas/migrations/0013_auto_20210406_1428.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0012_auto_20210406_1420'), + ] + + operations = [ + migrations.AlterModelOptions( + name='tipoorgao', + options={'verbose_name': 'Tipo de \xf3rg\xe3o', 'verbose_name_plural': 'Tipos de \xf3rg\xe3o'}, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 14e4cac..71939c0 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -24,6 +24,10 @@ class TipoOrgao(models.Model): sigla = models.CharField(_(u"Sigla"), max_length=5) nome = models.CharField(_(u"Nome"), max_length=100) + class Meta: + verbose_name = _(u"Tipo de órgão") + verbose_name_plural = _(u"Tipos de órgão") + def __unicode__(self): return self.nome diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 3283527..afc56ae 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -21,7 +21,7 @@ main_menu: url: casas/portfolio/ - title: Carteira de relacionamentos url: casas/carteira - - title: Tipos de Casas + - title: Tipos de órgãos url: casas/tipoorgao/ # - title: Legislaturas # url: parlamentares/legislatura/ From f4fa5f0e92523639873fb60cec893c34ed999f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 6 Apr 2021 16:37:12 -0300 Subject: [PATCH 27/69] =?UTF-8?q?Ignorar=20configura=C3=A7=C3=B5es=20do=20?= =?UTF-8?q?vscode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 45262ed..b33797c 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ db.* .project .pydevproject .settings +.vscode/ .vagrant sigi/settings/prod.py From d6099d082c2100ec364e336f8d3009920c782fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 12 Apr 2021 01:06:47 -0300 Subject: [PATCH 28/69] Fix #20 --- etc/migracao/migra.py | 22 +-- locale/en/LC_MESSAGES/django.po | 2 +- scripts/importa_pesquisa.py | 50 +++---- .../verificacao_arquivos_faltando_media.py | 4 +- sigi/apps/casas/admin.py | 126 +++++++++--------- sigi/apps/casas/forms.py | 17 ++- .../management/commands/importa_gerentes.py | 34 ++--- .../migrations/0014_auto_20210406_1945.py | 31 +++++ .../migrations/0015_auto_20210407_0801.py | 28 ++++ .../migrations/0016_auto_20210407_1559.py | 20 +++ sigi/apps/casas/models.py | 51 ++++--- sigi/apps/casas/reports.py | 2 +- .../casas/lista_casas_carteira_snippet.html | 10 +- sigi/apps/casas/test_casas.py | 4 +- sigi/apps/casas/urls.py | 28 ++-- sigi/apps/casas/views.py | 36 ++--- sigi/apps/convenios/admin.py | 85 +++++++----- .../migrations/0003_auto_20210406_1945.py | 21 +++ .../migrations/0004_auto_20210407_1928.py | 78 +++++++++++ .../migrations/0005_auto_20210409_0842.py | 26 ++++ sigi/apps/convenios/models.py | 82 +++++++++--- .../templates/convenios/change_list.html | 70 ++++++++-- sigi/apps/convenios/views.py | 4 +- sigi/apps/diagnosticos/forms.py | 10 +- .../migrations/0004_auto_20210406_1945.py | 21 +++ sigi/apps/diagnosticos/models.py | 2 +- sigi/apps/diagnosticos/views.py | 6 +- .../migrations/0005_auto_20210406_1945.py | 27 ++++ sigi/apps/eventos/models.py | 34 ++--- sigi/apps/home/templatetags/menu_conf.yaml | 16 ++- sigi/apps/home/views.py | 52 ++++---- .../migrations/0002_auto_20210406_1945.py | 21 +++ sigi/apps/inventario/models.py | 2 +- .../migrations/0002_auto_20210406_1945.py | 21 +++ sigi/apps/metas/models.py | 4 +- sigi/apps/metas/templatetags/mapa_tags.py | 4 +- sigi/apps/metas/views.py | 44 +++--- .../migrations/0003_auto_20210406_1945.py | 21 +++ sigi/apps/ocorrencias/models.py | 8 +- sigi/apps/ocorrencias/views.py | 78 +++++------ .../migrations/0002_auto_20210406_1945.py | 27 ++++ sigi/apps/parlamentares/models.py | 6 +- sigi/apps/parlamentares/reports.py | 4 +- sigi/apps/parlamentares/views.py | 2 +- sigi/apps/servicos/admin.py | 9 +- .../migrations/0004_delete_casaatendida.py | 17 +++ .../migrations/0005_auto_20210406_1945.py | 27 ++++ .../servicos/migrations/0006_casaatendida.py | 25 ++++ sigi/apps/servicos/models.py | 10 +- .../servicos/casaatendida/change_list.html | 2 +- sigi/apps/servicos/views.py | 9 +- sigi/test_cart.py | 6 +- templates/admin/change_list.html | 4 +- 53 files changed, 934 insertions(+), 416 deletions(-) create mode 100644 sigi/apps/casas/migrations/0014_auto_20210406_1945.py create mode 100644 sigi/apps/casas/migrations/0015_auto_20210407_0801.py create mode 100644 sigi/apps/casas/migrations/0016_auto_20210407_1559.py create mode 100644 sigi/apps/convenios/migrations/0003_auto_20210406_1945.py create mode 100644 sigi/apps/convenios/migrations/0004_auto_20210407_1928.py create mode 100644 sigi/apps/convenios/migrations/0005_auto_20210409_0842.py create mode 100644 sigi/apps/diagnosticos/migrations/0004_auto_20210406_1945.py create mode 100644 sigi/apps/eventos/migrations/0005_auto_20210406_1945.py create mode 100644 sigi/apps/inventario/migrations/0002_auto_20210406_1945.py create mode 100644 sigi/apps/metas/migrations/0002_auto_20210406_1945.py create mode 100644 sigi/apps/ocorrencias/migrations/0003_auto_20210406_1945.py create mode 100644 sigi/apps/parlamentares/migrations/0002_auto_20210406_1945.py create mode 100644 sigi/apps/servicos/migrations/0004_delete_casaatendida.py create mode 100644 sigi/apps/servicos/migrations/0005_auto_20210406_1945.py create mode 100644 sigi/apps/servicos/migrations/0006_casaatendida.py diff --git a/etc/migracao/migra.py b/etc/migracao/migra.py index dc0cfff..b7f99e6 100755 --- a/etc/migracao/migra.py +++ b/etc/migracao/migra.py @@ -71,7 +71,7 @@ def migra_assembleias(filename): bairro = aux_end[1].replace(' ', '', 1) else: bairro = '' - casa = CasaLegislativa( + casa = Orgao( municipio=municipio, nome=line[NOME_COL], tipo=tipo_casa, @@ -160,7 +160,7 @@ def migra_casas(filename): bairro = '' if(aux_end.__len__() > 1): bairro = aux_end[1].replace(' ', '', 1) - casa = CasaLegislativa( + casa = Orgao( municipio=municipio, nome='Câmara Municipal de ' + line[NOME_COL], tipo=tipo_casa, @@ -214,11 +214,11 @@ def migra_cnpj(filename): linenum += 1 try: - casa = CasaLegislativa.objects.get(municipio__codigo_tse=line[COD_TSE_COL]) - except CasaLegislativa.DoesNotExist: + casa = Orgao.objects.get(municipio__codigo_tse=line[COD_TSE_COL]) + except Orgao.DoesNotExist: print ERROR_MSG_1 % (filename, linenum) continue - except CasaLegislativa.MultipleObjectsReturned: + except Orgao.MultipleObjectsReturned: print ERROR_MSG_1 % (filename, linenum) continue except ValueError: @@ -271,12 +271,12 @@ def migra_convenios_casas(filename): linenum += 1 try: - casa = CasaLegislativa.objects.get(municipio__codigo_ibge=line[COD_IBGE_COL]) - except CasaLegislativa.DoesNotExist: + casa = Orgao.objects.get(municipio__codigo_ibge=line[COD_IBGE_COL]) + except Orgao.DoesNotExist: print "Erro ao inserir convênio. Casa não existe" print ERROR_MSG_1 % (filename, linenum) continue - except CasaLegislativa.MultipleObjectsReturned: + except Orgao.MultipleObjectsReturned: print ERROR_MSG_1 % (filename, linenum) continue except ValueError: @@ -373,11 +373,11 @@ def migra_convenios_assembleias(filename): linenum += 1 try: - assembleia = CasaLegislativa.objects.get(municipio__uf__sigla=line[SIGLA_COL], tipo=tipo_casa) - except CasaLegislativa.DoesNotExist: + assembleia = Orgao.objects.get(municipio__uf__sigla=line[SIGLA_COL], tipo=tipo_casa) + except Orgao.DoesNotExist: print ERROR_MSG_1 % (filename, linenum) continue - except CasaLegislativa.MultipleObjectsReturned: + except Orgao.MultipleObjectsReturned: print ERROR_MSG_1 % (filename, linenum) continue except ValueError: diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index f7e49aa..709a9fe 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -901,7 +901,7 @@ msgid "Data de Aceite" msgstr "" #: sigi/apps/convenios/reports.py:143 -msgid "CasaLegislativa: " +msgid "Orgao: " msgstr "" #: sigi/apps/convenios/reports.py:250 diff --git a/scripts/importa_pesquisa.py b/scripts/importa_pesquisa.py index cac1c32..ad0c9c4 100644 --- a/scripts/importa_pesquisa.py +++ b/scripts/importa_pesquisa.py @@ -26,16 +26,16 @@ import csv import urlparse from datetime import datetime -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.servidores.models import Servidor def importa(file_list): - ''' Este script importa dados de um arquivo CSV e dá carga no model casas.CasaLegislativa + ''' Este script importa dados de um arquivo CSV e dá carga no model casas.Orgao O arquivo CSV esperado tem um cabeçalho de campos na primeira linha, com os seguintes campos: - + Indicação de data e hora,Pesquisador,Câmara,Possui portal,Portal Modelo,URL,Observações - + Indicação de data e hora: Uma string datetime no formato %d/%m/%y %H:%M Pesquisador: O nome do servidor que realizou a pesquisa, conforme cadastrado no SIGI Câmara: A sigla da UF seguida de um espaço, seguido de um caracter - seguido de um espaço seguido do nome do município, @@ -43,19 +43,19 @@ def importa(file_list): Possui portal: Deve constar "sim" ou "não" indicando se a casa possui ou não portal. Portal Modelo: Deve constar "sim" ou "não" indicando se o portal da casa é o portal modelo ou não. URL: Deve conter a URL do portal da Casa. Opcionalmente pode ter alguma observação do pesquisador - Observações: Deve conter as observações do pesquisador, caso existam.''' - + Observações: Deve conter as observações do pesquisador, caso existam.''' + for filename in file_list: print 'Importando '+filename+'.csv' with open(filename+'.csv', 'rb') as infile: with open(filename+'.out', 'wb') as outfile: indata = csv.reader(infile, delimiter=',', quotechar='"') outdata = csv.writer(outfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_ALL) - + head = next(indata) head.append('Erros encontrados') outdata.writerow(head) - + for row in indata: data = row[0].strip() pesquisador = row[1].strip() @@ -64,32 +64,32 @@ def importa(file_list): pmodelo = row[4].strip() url = row[5].strip() obs = row[6].strip() - + if data == '': data = None else: data = datetime.strptime(data, '%d/%m/%y %H:%M') - + uf = uf_cidade[:2] cidade = uf_cidade[5:] - + if tem_portal.lower() == 'não': - inclusao = CasaLegislativa.INCLUSAO_DIGITAL_CHOICES[1][0] + inclusao = Orgao.INCLUSAO_DIGITAL_CHOICES[1][0] elif pmodelo.lower() == 'não': - inclusao = CasaLegislativa.INCLUSAO_DIGITAL_CHOICES[3][0] + inclusao = Orgao.INCLUSAO_DIGITAL_CHOICES[3][0] else: - inclusao = CasaLegislativa.INCLUSAO_DIGITAL_CHOICES[2][0] - + inclusao = Orgao.INCLUSAO_DIGITAL_CHOICES[2][0] + l = url.splitlines() url = '' - + for s in l: p = urlparse.urlparse(s) if p.netloc: url = s else: obs = obs + '\n' + s - + if pesquisador == '': servidor = None else: @@ -101,8 +101,8 @@ def importa(file_list): continue else: servidor = servidor[0] - - casa = CasaLegislativa.objects.filter(tipo_id=1, municipio__uf__sigla=uf, municipio__nome__iexact=cidade) + + casa = Orgao.objects.filter(tipo_id=1, municipio__uf__sigla=uf, municipio__nome__iexact=cidade) cc = casa.count() if cc == 0: row.append('Municipio nao foi encontrado') @@ -114,18 +114,18 @@ def importa(file_list): continue else: casa = casa[0] - + casa.inclusao_digital = inclusao casa.data_levantamento = data casa.pesquisador = servidor - + if casa.pagina_web == '': casa.pagina_web = url else: obs = url + '\n' + obs - + casa.obs_pesquisa = obs casa.save() - - print 'O arquivo '+filename+'.out foi criado com os registros que nao puderam ser importados' - + + print 'O arquivo '+filename+'.out foi criado com os registros que nao puderam ser importados' + diff --git a/scripts/verificacao_arquivos_faltando_media.py b/scripts/verificacao_arquivos_faltando_media.py index 90cc79f..367b6f6 100644 --- a/scripts/verificacao_arquivos_faltando_media.py +++ b/scripts/verificacao_arquivos_faltando_media.py @@ -9,7 +9,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from terminaltables import AsciiTable -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.convenios.models import Anexo as AnexoConvenios from sigi.apps.diagnosticos.models import Anexo as AnexoDiagnosticos from sigi.apps.ocorrencias.models import Anexo as AnexoOcorrencias @@ -31,7 +31,7 @@ def url(obj): # IMAGENS FALTANDO imagens_faltando = [[u"SITUAÇÃO DO ARQUIVO DA FOTO ", "URL", "OBJETO"]] -for cl in (CasaLegislativa, Parlamentar, Servidor): +for cl in (Orgao, Parlamentar, Servidor): for a in cl.objects.all(): if a.foto: imagens_faltando.append([ diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index ed511d9..7cd039e 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -8,18 +8,18 @@ from django.shortcuts import render from django.utils.translation import ugettext as _ from image_cropping import ImageCroppingMixin -from sigi.apps.casas.forms import CasaLegislativaForm -from sigi.apps.casas.models import CasaLegislativa, Presidente, Funcionario, TipoOrgao +from sigi.apps.casas.forms import OrgaoForm +from sigi.apps.casas.models import Orgao, Presidente, Funcionario, TipoOrgao from sigi.apps.casas.views import report_complete, labels_report, export_csv, \ labels_report_sem_presidente, report, \ adicionar_casas_carrinho from sigi.apps.contatos.models import Telefone from sigi.apps.convenios.models import Convenio, Projeto -from sigi.apps.diagnosticos.models import Diagnostico -from sigi.apps.inventario.models import Bem +# from sigi.apps.diagnosticos.models import Diagnostico +# from sigi.apps.inventario.models import Bem from sigi.apps.metas.models import PlanoDiretor from sigi.apps.ocorrencias.models import Ocorrencia -from sigi.apps.parlamentares.models import Legislatura +# from sigi.apps.parlamentares.models import Legislatura from sigi.apps.servicos.models import Servico, TipoServico from sigi.apps.servidores.models import Servidor from sigi.apps.utils import queryset_ascii @@ -129,7 +129,7 @@ class ConveniosInline(admin.TabularInline): return "" status = obj.get_status() - if status in [u"Vencido", u"Desistência"]: + if status in [u"Vencido", u"Desistência", u"Cancelado"]: label = r"danger" elif status == u"Vigente": label = r"success" @@ -164,51 +164,47 @@ class ConveniosInline(admin.TabularInline): link_sigad.short_description = _("Processo no Senado") link_sigad.allow_tags = True - -class LegislaturaInline(admin.TabularInline): - model = Legislatura - fields = ['numero', 'data_inicio', 'data_fim', 'data_eleicao', 'total_parlamentares', 'link_parlamentares', ] - readonly_fields = ['link_parlamentares', ] - - def link_parlamentares(self, obj): - if obj.pk is None: - return "" - from django.core.urlresolvers import reverse - url = reverse('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.module_name), args=[obj.pk]) - url = url + '?_popup=1' - return """ - - Editar - """ % (obj.pk, obj.pk, url) - - link_parlamentares.short_description = _(u'Parlamentares') - link_parlamentares.allow_tags = True - - -class DiagnosticoInline(admin.TabularInline): - model = Diagnostico - fields = ['data_visita_inicio', 'data_visita_fim', 'publicado', 'data_publicacao', 'responsavel', 'link_diagnostico', ] - readonly_fields = ['data_visita_inicio', 'data_visita_fim', 'publicado', 'data_publicacao', 'responsavel', 'link_diagnostico', ] - extra = 0 - max_num = 0 - can_delete = False - - def link_diagnostico(self, obj): - if obj.pk is None: - return "" - url = reverse('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.module_name), args=["%s.pdf" % obj.pk]) - return """ - - Abrir PDF - """ % (obj.pk, obj.pk, url) - - link_diagnostico.short_description = _(u'Ver PDF') - link_diagnostico.allow_tags = True - - -class BemInline(admin.TabularInline): - model = Bem - +# class LegislaturaInline(admin.TabularInline): +# model = Legislatura +# fields = ['numero', 'data_inicio', 'data_fim', 'data_eleicao', 'total_parlamentares', 'link_parlamentares', ] +# readonly_fields = ['link_parlamentares', ] + +# def link_parlamentares(self, obj): +# if obj.pk is None: +# return "" +# from django.core.urlresolvers import reverse +# url = reverse('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.module_name), args=[obj.pk]) +# url = url + '?_popup=1' +# return """ +# +# Editar +# """ % (obj.pk, obj.pk, url) + +# link_parlamentares.short_description = _(u'Parlamentares') +# link_parlamentares.allow_tags = True + +# class DiagnosticoInline(admin.TabularInline): +# model = Diagnostico +# fields = ['data_visita_inicio', 'data_visita_fim', 'publicado', 'data_publicacao', 'responsavel', 'link_diagnostico', ] +# readonly_fields = ['data_visita_inicio', 'data_visita_fim', 'publicado', 'data_publicacao', 'responsavel', 'link_diagnostico', ] +# extra = 0 +# max_num = 0 +# can_delete = False + +# def link_diagnostico(self, obj): +# if obj.pk is None: +# return "" +# url = reverse('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.module_name), args=["%s.pdf" % obj.pk]) +# return """ +# +# Abrir PDF +# """ % (obj.pk, obj.pk, url) + +# link_diagnostico.short_description = _(u'Ver PDF') +# link_diagnostico.allow_tags = True + +# class BemInline(admin.TabularInline): +# model = Bem class ServicoInline(admin.TabularInline): model = Servico @@ -218,10 +214,8 @@ class ServicoInline(admin.TabularInline): max_num = 0 can_delete = False - -class PlanoDiretorInline(admin.TabularInline): - model = PlanoDiretor - +# class PlanoDiretorInline(admin.TabularInline): +# model = PlanoDiretor class OcorrenciaInline(admin.TabularInline): model = Ocorrencia @@ -309,12 +303,11 @@ class ServicoFilter(admin.SimpleListFilter): return queryset.distinct('municipio__uf__nome', 'nome') -class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): - form = CasaLegislativaForm +class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): + form = OrgaoForm actions = ['adicionar_casas', ] inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, - ConveniosInline, LegislaturaInline, DiagnosticoInline, BemInline, - ServicoInline, PlanoDiretorInline, OcorrenciaInline,) + ConveniosInline, ServicoInline, OcorrenciaInline,) list_display = ('nome', 'get_uf', 'get_gerentes', 'get_convenios', 'get_servicos') list_display_links = ('nome',) @@ -342,7 +335,7 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): }), ) raw_id_fields = ('municipio',) - readonly_fields = ['num_parlamentares', ] + readonly_fields = ['num_parlamentares', 'gerentes_interlegis',] search_fields = ('search_text', 'cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') @@ -374,14 +367,17 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): get_servicos.allow_tags = True def changelist_view(self, request, extra_context=None): - return super(CasaLegislativaAdmin, self).changelist_view( + return super(OrgaoAdmin, self).changelist_view( request, extra_context={'query_str': '?' + request.META['QUERY_STRING']} ) def lookup_allowed(self, lookup, value): - return super(CasaLegislativaAdmin, self).lookup_allowed(lookup, value) or \ - lookup in ['municipio__uf__codigo_ibge__exact', 'convenio__projeto__id__exact'] + return (super(OrgaoAdmin, self).lookup_allowed(lookup, value) or + lookup in ['tipo__legislativo__exact', + 'tipo__sigla__exact', + 'municipio__uf__codigo_ibge__exact', + 'convenio__projeto__id__exact']) def etiqueta(self, request, queryset): return labels_report(request, queryset=queryset) @@ -426,11 +422,11 @@ class CasaLegislativaAdmin(ImageCroppingMixin, BaseModelAdmin): adicionar_casas.short_description = _(u"Armazenar casas no carrinho para exportar") def get_actions(self, request): - actions = super(CasaLegislativaAdmin, self).get_actions(request) + actions = super(OrgaoAdmin, self).get_actions(request) if 'delete_selected' in actions: del actions['delete_selected'] return actions -admin.site.register(CasaLegislativa, CasaLegislativaAdmin) +admin.site.register(Orgao, OrgaoAdmin) admin.site.register(TipoOrgao) diff --git a/sigi/apps/casas/forms.py b/sigi/apps/casas/forms.py index fcaf3a5..dca4889 100644 --- a/sigi/apps/casas/forms.py +++ b/sigi/apps/casas/forms.py @@ -3,11 +3,11 @@ from django import forms from django.utils.translation import ugettext as _ from localflavor.br.forms import BRZipCodeField -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.servidores.models import Servidor -class CasaLegislativaForm(forms.ModelForm): +class OrgaoForm(forms.ModelForm): # cnpj = BRCNPJField( # label=_(u'CNPJ'), # required=False, @@ -16,9 +16,16 @@ class CasaLegislativaForm(forms.ModelForm): cep = BRZipCodeField(label=_(u'CEP'), help_text=_(u'Formato') + ': XXXXX-XXX.') class Meta: - model = CasaLegislativa + model = Orgao fields = '__all__' - + + # def clean(self): + # cleaned_data = super(OrgaoForm, self).clean() + # tipo = cleaned_data.get('tipo') + # municipio = cleaned_data.get('municipio') + # if tipo.legislativo: + # if Orgao.objects.filter(tipo=tipo) + class PortfolioForm(forms.Form): ACAO_CHOICES = ( ('ADD', _(u"Adicionar")), @@ -34,7 +41,7 @@ class PortfolioForm(forms.Form): queryset=Servidor.objects.all(), label=_(u"Atribuir para") ) - + # O label precisa ser trocado dependendo da região que se está visualizando def __init__(self, label=_(u"Atribuir para"), *args, **kwargs): super(PortfolioForm, self).__init__(*args, **kwargs) diff --git a/sigi/apps/casas/management/commands/importa_gerentes.py b/sigi/apps/casas/management/commands/importa_gerentes.py index 5994980..ce3d009 100644 --- a/sigi/apps/casas/management/commands/importa_gerentes.py +++ b/sigi/apps/casas/management/commands/importa_gerentes.py @@ -25,41 +25,41 @@ import csv import os from django.core.management.base import BaseCommand, CommandError -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.servidores.models import Servidor from sigi.apps.contatos.models import Municipio class Command(BaseCommand): args = u"data_file.csv" help = u"""Importa dados de atribuição de gerencia de relacionamentos de um arquivo CSV. - + A primeira linha do arquivo deve possuir um cabeçalho com os seguintes campos obrigatórios: - cod_municipio : Código IBGE do município - user_id : Nome de usuário (usado no login) do gerente de relacionamento da Casa - + * Os nomes dos campos devem ser grafados exatamente como descrito.""" - + campos = {'cod_municipio', 'user_id'} - + def handle(self, *args, **options): if len(args) != 1: raise CommandError(u"Informe UM arquivo csv a importar") - + file_name = args[0] - + if not os.path.isfile(file_name): raise CommandError(u"Arquivo %s não encontrado" % [file_name,]) - + with open(file_name, 'rb') as csvfile: reader = csv.DictReader(csvfile) - + if not self.campos.issubset(reader.fieldnames): raise CommandError(u"O arquivo não possui todos os campos obrigatórios") - - CasaLegislativa.gerentes_interlegis.through.objects.all().delete() - + + Orgao.gerentes_interlegis.through.objects.all().delete() + erros = 0 - + for reg in reader: try: municipio = Municipio.objects.get( @@ -86,13 +86,13 @@ class Command(BaseCommand): ) erros = erros + 1 continue - - for casa in municipio.casalegislativa_set.filter( + + for casa in municipio.orgao_set.filter( tipo__sigla__in=['AL', 'CM']): casa.gerentes_interlegis.add(gerente) casa.save() - + self.stdout.write(u"Importação concluída. {erros} erros em {linhas}" - u" linhas".format(erros=erros, + u" linhas".format(erros=erros, linhas=reader.line_num) ) \ No newline at end of file diff --git a/sigi/apps/casas/migrations/0014_auto_20210406_1945.py b/sigi/apps/casas/migrations/0014_auto_20210406_1945.py new file mode 100644 index 0000000..32ee5a2 --- /dev/null +++ b/sigi/apps/casas/migrations/0014_auto_20210406_1945.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import image_cropping.fields +import sigi.apps.utils + + +class Migration(migrations.Migration): + + dependencies = [ + # ('metas', '0002_auto_20210406_1945'), + ('contatos', '0002_auto_20151104_0810'), + ('servidores', '0001_initial'), + # ('parlamentares', '0002_auto_20210406_1945'), + # ('servicos', '0005_auto_20210406_1945'), + ('servicos', '0004_delete_casaatendida'), + # ('inventario', '0002_auto_20210406_1945'), + # ('convenios', '0003_auto_20210406_1945'), + # ('ocorrencias', '0003_auto_20210406_1945'), + # ('diagnosticos', '0004_auto_20210406_1945'), + # ('eventos', '0005_auto_20210406_1945'), + ('casas', '0013_auto_20210406_1428'), + ] + + operations = [ + migrations.RenameModel( + old_name='CasaLegislativa', + new_name='Orgao', + ), + ] diff --git a/sigi/apps/casas/migrations/0015_auto_20210407_0801.py b/sigi/apps/casas/migrations/0015_auto_20210407_0801.py new file mode 100644 index 0000000..93f7b4b --- /dev/null +++ b/sigi/apps/casas/migrations/0015_auto_20210407_0801.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterModelOptions( + name='orgao', + options={'ordering': ('nome',), 'verbose_name': '\xd3rg\xe3o', 'verbose_name_plural': '\xd3rg\xe3os'}, + ), + migrations.AddField( + model_name='tipoorgao', + name='legislativo', + field=models.BooleanField(default=False, verbose_name='Poder legislativo'), + preserve_default=True, + ), + migrations.AlterUniqueTogether( + name='orgao', + unique_together=set([]), + ), + ] diff --git a/sigi/apps/casas/migrations/0016_auto_20210407_1559.py b/sigi/apps/casas/migrations/0016_auto_20210407_1559.py new file mode 100644 index 0000000..91b5347 --- /dev/null +++ b/sigi/apps/casas/migrations/0016_auto_20210407_1559.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0015_auto_20210407_0801'), + ] + + operations = [ + migrations.AlterField( + model_name='orgao', + name='gerentes_interlegis', + field=models.ManyToManyField(related_name='casas_que_gerencia', verbose_name='Gerentes Interlegis', to='servidores.Servidor', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 71939c0..38548fd 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -3,6 +3,7 @@ from datetime import datetime import random from string import ascii_uppercase from unicodedata import normalize +from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ from django.contrib.contenttypes import generic from django.db import models @@ -12,9 +13,7 @@ from sigi.apps.contatos.models import Municipio from sigi.apps.servidores.models import Servidor from sigi.apps.utils import SearchField - class TipoOrgao(models.Model): - """ Modelo para representar o tipo da Casa Legislativa Geralmente: Câmara Municipal, Assembléia Legislativa, @@ -23,6 +22,7 @@ class TipoOrgao(models.Model): sigla = models.CharField(_(u"Sigla"), max_length=5) nome = models.CharField(_(u"Nome"), max_length=100) + legislativo = models.BooleanField(_(u"Poder legislativo"), default=False) class Meta: verbose_name = _(u"Tipo de órgão") @@ -31,9 +31,7 @@ class TipoOrgao(models.Model): def __unicode__(self): return self.nome - -class CasaLegislativa(models.Model): - +class Orgao(models.Model): """ Modelo para representar uma Casa Legislativa """ @@ -72,7 +70,8 @@ class CasaLegislativa(models.Model): gerentes_interlegis = models.ManyToManyField( Servidor, verbose_name=_(u"Gerentes Interlegis"), - related_name='casas_que_gerencia' + related_name='casas_que_gerencia', + blank=True, ) # Informações de contato @@ -143,9 +142,8 @@ class CasaLegislativa(models.Model): class Meta: ordering = ('nome',) - unique_together = ('municipio', 'tipo') - verbose_name = _(u'Casa Legislativa') - verbose_name_plural = _(u'Casas Legislativas') + verbose_name = _(u'Órgão') + verbose_name_plural = _(u'Órgãos') def lista_gerentes(self, fmt='html'): if not self.gerentes_interlegis.exists(): @@ -210,7 +208,7 @@ class CasaLegislativa(models.Model): if codigo == '': if self.tipo.sigla == 'AL': # Assembléias são tratadas a parte codigo = 'A' + self.municipio.uf.sigla - if CasaLegislativa.objects.filter(codigo_interlegis=codigo).count() <= 0: + if Orgao.objects.filter(codigo_interlegis=codigo).count() <= 0: # Só grava o código se ele for inédito self.codigo_interlegis = codigo self.save() @@ -243,7 +241,7 @@ class CasaLegislativa(models.Model): cityName = cityName.replace(' ', '') ultima = len(cityName) - while CasaLegislativa.objects.filter(codigo_interlegis=codigo). \ + while Orgao.objects.filter(codigo_interlegis=codigo). \ count() > 0 and ultima > 0: codigo = codigo[:2] + cityName[ultima - 1: ultima] ultima -= 1 @@ -252,11 +250,11 @@ class CasaLegislativa(models.Model): # não gerou um código único, então vamos compor o nome usando as # três primeiras consoantes. - if CasaLegislativa.objects.filter(codigo_interlegis=codigo).count() > 0: + if Orgao.objects.filter(codigo_interlegis=codigo).count() > 0: codigo_cons = cityName.replace('A', '').replace('E', '').\ replace('I', '').replace('O', '').replace('U', '')[:3] if len(codigo_cons) == 3 and \ - CasaLegislativa.objects.filter(codigo_interlegis=codigo).count() > 0: + Orgao.objects.filter(codigo_interlegis=codigo).count() > 0: codigo = codigo_cons # Se ainda não gerou um nome único, vamos colocar dígitos no @@ -264,7 +262,7 @@ class CasaLegislativa(models.Model): i = 'A' - while CasaLegislativa.objects.filter(codigo_interlegis=codigo). \ + while Orgao.objects.filter(codigo_interlegis=codigo). \ count() > 0 and i <= 'Z': codigo = codigo[:2] + str(i) i = chr(ord(i) + 1) @@ -275,7 +273,7 @@ class CasaLegislativa(models.Model): i = 0 - while CasaLegislativa.objects.filter(codigo_interlegis=codigo). \ + while Orgao.objects.filter(codigo_interlegis=codigo). \ count() > 0 and i < 100: codigo = random.choice(cityName) + random.choice(cityName) + \ random.choice(cityName) @@ -286,10 +284,8 @@ class CasaLegislativa(models.Model): i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - while CasaLegislativa.objects.filter(codigo_interlegis=codigo). \ - count() > 0: - codigo = random.choice(i) + random.choice(i) + \ - random.choice(i) + while Orgao.objects.filter(codigo_interlegis=codigo).count() > 0: + codigo = random.choice(i) + random.choice(i) + random.choice(i) self.codigo_interlegis = codigo self.save() @@ -299,11 +295,22 @@ class CasaLegislativa(models.Model): def __unicode__(self): return self.nome + def clean(self): + if (hasattr(self, 'tipo') and hasattr(self, 'municipio') + and self.tipo.legislativo): + if Orgao.objects.filter( + tipo=self.tipo, + municipio=self.municipio).exclude(pk=self.pk).exists(): + raise ValidationError( + _(u"Já existe um(a) %(tipo)s em %(municipio)s"), + code='integrity', + params={'tipo': self.tipo, 'municipio': self.municipio}) + def save(self, *args, **kwargs): address_changed = False if self.pk is not None: - original = CasaLegislativa.objects.get(pk=self.pk) + original = Orgao.objects.get(pk=self.pk) if (self.logradouro != original.logradouro or self.bairro != original.bairro or self.municipio != original.municipio or @@ -315,7 +322,7 @@ class CasaLegislativa(models.Model): if address_changed: self.ult_alt_endereco = datetime.now() - return super(CasaLegislativa, self).save(*args, **kwargs) + return super(Orgao, self).save(*args, **kwargs) class Funcionario(models.Model): @@ -343,7 +350,7 @@ class Funcionario(models.Model): ("F", _(u"Feminino")) ] - casa_legislativa = models.ForeignKey(CasaLegislativa) + casa_legislativa = models.ForeignKey(Orgao) nome = models.CharField(_(u'nome completo'), max_length=60, blank=False) # nome.alphabetic_filter = True sexo = models.CharField( diff --git a/sigi/apps/casas/reports.py b/sigi/apps/casas/reports.py index e6e27c3..c2a380a 100644 --- a/sigi/apps/casas/reports.py +++ b/sigi/apps/casas/reports.py @@ -52,7 +52,7 @@ class CasasLegislativasLabels(Report): Usage example:: >>> from geraldo.generators import PDFGenerator - >>> queryset = CasaLegislativa.objects.filter(municipio__uf__sigla='MG') + >>> queryset = Orgao.objects.filter(municipio__uf__sigla='MG') >>> report = LabelsReport(queryset) >>> report.generate_by(PDFGenerator, filename='./inline-detail-report.pdf') diff --git a/sigi/apps/casas/templates/casas/lista_casas_carteira_snippet.html b/sigi/apps/casas/templates/casas/lista_casas_carteira_snippet.html index bcd53a4..0b2e4d7 100644 --- a/sigi/apps/casas/templates/casas/lista_casas_carteira_snippet.html +++ b/sigi/apps/casas/templates/casas/lista_casas_carteira_snippet.html @@ -31,26 +31,26 @@ {% endfor %} - + - + - +
    - + {% if page_obj %}
    @@ -64,7 +64,7 @@ {% for casa in page_obj.object_list %} - + diff --git a/sigi/apps/casas/test_casas.py b/sigi/apps/casas/test_casas.py index fe491ab..a2026ec 100644 --- a/sigi/apps/casas/test_casas.py +++ b/sigi/apps/casas/test_casas.py @@ -1,7 +1,7 @@ import pytest from django_dynamic_fixture import G -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao @pytest.fixture @@ -14,4 +14,4 @@ def some_parliaments(): def parliaments_from_names(names): - return [G(CasaLegislativa, nome=name, foto=None,) for name in names] + return [G(Orgao, nome=name, foto=None,) for name in names] diff --git a/sigi/apps/casas/urls.py b/sigi/apps/casas/urls.py index 5381364..df6bf9f 100644 --- a/sigi/apps/casas/urls.py +++ b/sigi/apps/casas/urls.py @@ -6,33 +6,33 @@ urlpatterns = patterns( 'sigi.apps.casas.views', # Informacoes de uma casa legislativa - url(r'^casalegislativa/report_complete/$', 'report_complete', name='report-complete-all'), - url(r'^casalegislativa/(?P\w+)/report_complete/$', 'report_complete', name='report-complete-id'), + url(r'^orgao/report_complete/$', 'report_complete', name='report-complete-all'), + url(r'^orgao/(?P\w+)/report_complete/$', 'report_complete', name='report-complete-id'), # Reports Labels - url(r'^casalegislativa/labels/$', 'labels_report', name='labels-report-all'), - url(r'^casalegislativa/(?P\w+)/labels/$', 'labels_report', name='labels-report-id'), + url(r'^orgao/labels/$', 'labels_report', name='labels-report-all'), + url(r'^orgao/(?P\w+)/labels/$', 'labels_report', name='labels-report-id'), # Reports Labels Parlamentar - url(r'^casalegislativa/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), - url(r'^casalegislativa/(?P\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), + url(r'^orgao/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), + url(r'^orgao/(?P\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), # Reports labels sem presidente - url(r'^casalegislativa/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), - url(r'^casalegislativa/(?P\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), + url(r'^orgao/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), + url(r'^orgao/(?P\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), # Reports casas sem convenio - url(r'^casalegislativa/reports/$', 'report', name='casa-report'), - url(r'^casalegislativa/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), + url(r'^orgao/reports/$', 'report', name='casa-report'), + url(r'^orgao/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), # CSV - url(r'^casalegislativa/csv/$', 'export_csv', name='casa-export-csv'), # Error + url(r'^orgao/csv/$', 'export_csv', name='casa-export-csv'), # Error # Carrinho - url(r'^casalegislativa/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), - url(r'^casalegislativa/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error - url(r'^casalegislativa/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error + url(r'^orgao/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), + url(r'^orgao/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error + url(r'^orgao/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), ) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 9b431e3..03a6243 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -11,7 +11,7 @@ from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _, ungettext from sigi.apps.casas.forms import PortfolioForm -from sigi.apps.casas.models import CasaLegislativa, TipoOrgao +from sigi.apps.casas.models import Orgao, TipoOrgao from sigi.apps.casas.reports import (CasasLegislativasLabels, CasasLegislativasLabelsSemPresidente) from sigi.apps.contatos.models import UnidadeFederativa, Mesorregiao, Microrregiao @@ -25,8 +25,8 @@ from sigi.shortcuts import render_to_pdf # @param qs: queryset # @param o: (int) number of order field def query_ordena(qs, o): - from sigi.apps.casas.admin import CasaLegislativaAdmin - list_display = CasaLegislativaAdmin.list_display + from sigi.apps.casas.admin import OrgaoAdmin + list_display = OrgaoAdmin.list_display order_fields = [] for order_number in o.split('.'): @@ -95,9 +95,9 @@ def carrinhoOrGet_for_qs(request): """ if 'carrinho_casas' in request.session: ids = request.session['carrinho_casas'] - qs = CasaLegislativa.objects.filter(pk__in=ids) + qs = Orgao.objects.filter(pk__in=ids) else: - qs = CasaLegislativa.objects.all() + qs = Orgao.objects.all() if request.GET: qs = get_for_qs(request.GET, qs) return qs @@ -189,7 +189,7 @@ def labels_report(request, id=None, tipo=None, formato='3x9_etiqueta'): return labels_report_sem_presidente(request, id, formato) if id: - qs = CasaLegislativa.objects.filter(pk=id) + qs = Orgao.objects.filter(pk=id) else: qs = carrinhoOrGet_for_qs(request) @@ -214,7 +214,7 @@ def labels_report_parlamentar(request, id=None, formato='3x9_etiqueta'): formato = request.POST['tamanho_etiqueta'] if id: - legislaturas = [c.legislatura_set.latest('data_inicio') for c in CasaLegislativa.objects.filter(pk__in=id, legislatura__id__isnull=False).distinct()] + legislaturas = [c.legislatura_set.latest('data_inicio') for c in Orgao.objects.filter(pk__in=id, legislatura__id__isnull=False).distinct()] mandatos = reduce(lambda x, y: x | y, [l.mandato_set.all() for l in legislaturas]) parlamentares = [m.parlamentar for m in mandatos] qs = parlamentares @@ -239,12 +239,12 @@ def carrinhoOrGet_for_parlamentar_qs(request): """ if 'carrinho_casas' in request.session: ids = request.session['carrinho_casas'] - legislaturas = [c.legislatura_set.latest('data_inicio') for c in CasaLegislativa.objects.filter(pk__in=ids, legislatura__id__isnull=False).distinct()] + legislaturas = [c.legislatura_set.latest('data_inicio') for c in Orgao.objects.filter(pk__in=ids, legislatura__id__isnull=False).distinct()] mandatos = reduce(lambda x, y: x | y, [l.mandato_set.all() for l in legislaturas]) parlamentares = [m.parlamentar for m in mandatos] qs = parlamentares else: - legislaturas = [c.legislatura_set.latest('data_inicio') for c in CasaLegislativa.objects.all().distinct()] + legislaturas = [c.legislatura_set.latest('data_inicio') for c in Orgao.objects.all().distinct()] mandatos = reduce(lambda x, y: x | y, [l.mandato_set.all() for l in legislaturas]) parlamentares = [m.parlamentar for m in mandatos] qs = parlamentares @@ -259,7 +259,7 @@ def labels_report_sem_presidente(request, id=None, formato='2x5_etiqueta'): """ if id: - qs = CasaLegislativa.objects.filter(pk=id) + qs = Orgao.objects.filter(pk=id) else: qs = carrinhoOrGet_for_qs(request) @@ -285,7 +285,7 @@ def report(request, id=None, tipo=None): return report_complete(request, id) if id: - qs = CasaLegislativa.objects.filter(pk=id) + qs = Orgao.objects.filter(pk=id) else: qs = carrinhoOrGet_for_qs(request) @@ -302,7 +302,7 @@ def report(request, id=None, tipo=None): def report_complete(request, id=None): if id: - qs = CasaLegislativa.objects.filter(pk=id) + qs = Orgao.objects.filter(pk=id) else: qs = carrinhoOrGet_for_qs(request) @@ -314,7 +314,7 @@ def report_complete(request, id=None): @login_required def casas_sem_convenio_report(request): - qs = CasaLegislativa.objects.filter(convenio=None).order_by('municipio__uf', 'nome') + qs = Orgao.objects.filter(convenio=None).order_by('municipio__uf', 'nome') if request.GET: qs = get_for_qs(request.GET, qs) @@ -454,7 +454,7 @@ def portfolio(request): name=unicode(microrregiao)) ) data['querystring'] = 'micro={0}'.format(microrregiao.pk) - casas = CasaLegislativa.objects.filter( + casas = Orgao.objects.filter( municipio__microrregiao=microrregiao ) elif meso_id: @@ -470,7 +470,7 @@ def portfolio(request): _(u'Atribuir casas da mesorregiao {name} para').format( name=unicode(mesorregiao))) data['querystring'] = 'meso={0}'.format(mesorregiao.pk) - casas = CasaLegislativa.objects.filter( + casas = Orgao.objects.filter( municipio__microrregiao__mesorregiao=mesorregiao ) elif uf_id: @@ -483,7 +483,7 @@ def portfolio(request): _(u'Atribuir casas do estado {name} para').format( name=unicode(uf))) data['querystring'] = 'uf={0}'.format(uf.pk) - casas = CasaLegislativa.objects.filter(municipio__uf=uf) + casas = Orgao.objects.filter(municipio__uf=uf) elif regiao: data['regiao'] = regiao data['ufs'] = UnidadeFederativa.objects.filter(regiao=regiao) @@ -492,7 +492,7 @@ def portfolio(request): name=[x[1] for x in UnidadeFederativa.REGIAO_CHOICES if x[0] == regiao][0])) data['querystring'] = 'regiao={0}'.format(regiao) - casas = CasaLegislativa.objects.filter(municipio__uf__regiao=regiao) + casas = Orgao.objects.filter(municipio__uf__regiao=regiao) if casas: casas = casas.order_by('municipio__uf', @@ -687,7 +687,7 @@ def painel_relacionamento(request): casas = gerente.casas_que_gerencia.all() if gerente is None or not casas.exists(): - casas = CasaLegislativa.objects.exclude(gerentes_interlegis=None) + casas = Orgao.objects.exclude(gerentes_interlegis=None) gerente = None tipos_servico = TipoServico.objects.all() diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index f199c9a..f3b3311 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -4,29 +4,27 @@ from django.http import HttpResponse, HttpResponseRedirect from django.utils.translation import ugettext as _ from geraldo.generators import PDFGenerator -from sigi.apps.convenios.models import Projeto, Convenio, EquipamentoPrevisto, Anexo, Tramitacao +from sigi.apps.convenios.models import (Projeto, StatusConvenio, Convenio, + EquipamentoPrevisto, Anexo, Tramitacao) from sigi.apps.convenios.reports import ConvenioReport from sigi.apps.convenios.views import adicionar_convenios_carrinho from sigi.apps.utils import queryset_ascii from sigi.apps.utils.base_admin import BaseModelAdmin +from sigi.apps.servidores.models import Servidor - -class TramitacaoInline(admin.TabularInline): - model = Tramitacao - extra = 1 - +# class TramitacaoInline(admin.TabularInline): +# model = Tramitacao +# extra = 1 class AnexosInline(admin.TabularInline): model = Anexo extra = 2 exclude = ['data_pub', ] - -class EquipamentoPrevistoInline(admin.TabularInline): - model = EquipamentoPrevisto - extra = 2 - raw_id_fields = ('equipamento',) - +# class EquipamentoPrevistoInline(admin.TabularInline): +# model = EquipamentoPrevisto +# extra = 2 +# raw_id_fields = ('equipamento',) class AnexoAdmin(BaseModelAdmin): date_hierarchy = 'data_pub' @@ -36,14 +34,23 @@ class AnexoAdmin(BaseModelAdmin): search_fields = ('descricao', 'convenio__id', 'arquivo', 'convenio__casa_legislativa__nome') +class AcompanhaFilter(admin.filters.RelatedFieldListFilter): + def __init__(self, *args, **kwargs): + super(AcompanhaFilter, self).__init__(*args, **kwargs) + servidores = Servidor.objects.filter( + convenio__isnull=False).order_by('nome_completo').distinct() + self.lookup_choices = [(x.id, x) for x in servidores] class ConvenioAdmin(BaseModelAdmin): change_list_template = 'convenios/change_list.html' fieldsets = ( (None, {'fields': ('casa_legislativa', 'num_processo_sf', 'num_convenio', - 'projeto', 'observacao')} + 'projeto', 'data_sigad', 'data_sigi',)} ), + (_(u"Acompanhamento no gabinete"), + {'fields': ('status', 'acompanha', 'observacao',)} + ), (_(u'Datas'), {'fields': ('data_adesao', 'data_retorno_assinatura', 'duracao', 'data_termo_aceite', 'data_pub_diario', @@ -53,15 +60,16 @@ class ConvenioAdmin(BaseModelAdmin): {'fields': ('data_devolucao_sem_assinatura', 'data_retorno_sem_assinatura',)} ), ) + readonly_fields = ('data_sigi',) actions = ['adicionar_convenios'] - inlines = (TramitacaoInline, AnexosInline, EquipamentoPrevistoInline) + inlines = (AnexosInline,) list_display = ('num_convenio', 'casa_legislativa', 'get_uf', - 'status_convenio', 'link_sigad', 'data_adesao', - 'data_retorno_assinatura', 'duracao', 'data_pub_diario', - 'data_termo_aceite', 'projeto', - ) + 'status_convenio', 'link_sigad', 'data_retorno_assinatura', + 'duracao', 'projeto', 'status', 'acompanha',) list_display_links = ('num_convenio', 'casa_legislativa',) - list_filter = ('projeto', 'casa_legislativa__tipo', 'conveniada','equipada', 'casa_legislativa__municipio__uf', ) + list_filter = ('status', ('acompanha', AcompanhaFilter), 'projeto', + 'casa_legislativa__tipo', 'conveniada','equipada', + 'casa_legislativa__municipio__uf',) #date_hierarchy = 'data_adesao' ordering = ('casa_legislativa__tipo__sigla', 'casa_legislativa__municipio__uf', 'casa_legislativa') raw_id_fields = ('casa_legislativa',) @@ -79,7 +87,7 @@ class ConvenioAdmin(BaseModelAdmin): return "" status = obj.get_status() - if status in [u"Vencido", u"Desistência"]: + if status in [u"Vencido", u"Desistência", u"Cancelado"]: label = r"danger" elif status == u"Vigente": label = r"success" @@ -101,24 +109,26 @@ class ConvenioAdmin(BaseModelAdmin): link_sigad.allow_tags = True def changelist_view(self, request, extra_context=None): - import re + def normaliza_data(nome_param): + import re + if nome_param in request.GET: + value = request.GET.get(nome_param, '') + if value == '': + del request.GET[nome_param] + elif re.match('^\d*$', value): # Year only + # Complete with january 1st + request.GET[nome_param] = "%s-01-01" % value + elif re.match('^\d*\D\d*$', value): # Year and month + # Complete with 1st day of month + request.GET[nome_param] = '%s-01' % value + request.GET._mutable = True - if 'data_retorno_assinatura__gte' in request.GET: - value = request.GET.get('data_retorno_assinatura__gte', '') - if value == '': - del request.GET['data_retorno_assinatura__gte'] - elif re.match('^\d*$', value): # Year only - request.GET['data_retorno_assinatura__gte'] = "%s-01-01" % value # Complete with january 1st - elif re.match('^\d*\D\d*$', value): # Year and month - request.GET['data_retorno_assinatura__gte'] = '%s-01' % value # Complete with 1st day of month - if 'data_retorno_assinatura__lte' in request.GET: - value = request.GET.get('data_retorno_assinatura__lte', '') - if value == '': - del request.GET['data_retorno_assinatura__lte'] - elif re.match('^\d*$', value): # Year only - request.GET['data_retorno_assinatura__lte'] = "%s-01-01" % value # Complete with january 1st - elif re.match('^\d*\D\d*$', value): # Year and month - request.GET['data_retorno_assinatura__lte'] = '%s-01' % value # Complete with 1st day of month + normaliza_data('data_retorno_assinatura__gte') + normaliza_data('data_retorno_assinatura__lte') + normaliza_data('data_sigad__gte') + normaliza_data('data_sigad__lte') + normaliza_data('data_sigi__gte') + normaliza_data('data_sigi__lte') request.GET._mutable = False return super(ConvenioAdmin, self).changelist_view( @@ -169,5 +179,6 @@ class EquipamentoPrevistoAdmin(BaseModelAdmin): 'equipamento__modelo__modelo', 'equipamento__modelo__tipo__tipo') admin.site.register(Projeto) +admin.site.register(StatusConvenio) admin.site.register(Convenio, ConvenioAdmin) admin.site.register(EquipamentoPrevisto, EquipamentoPrevistoAdmin) diff --git a/sigi/apps/convenios/migrations/0003_auto_20210406_1945.py b/sigi/apps/convenios/migrations/0003_auto_20210406_1945.py new file mode 100644 index 0000000..1fd1c84 --- /dev/null +++ b/sigi/apps/convenios/migrations/0003_auto_20210406_1945.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('convenios', '0002_convenio_duracao'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='convenio', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/migrations/0004_auto_20210407_1928.py b/sigi/apps/convenios/migrations/0004_auto_20210407_1928.py new file mode 100644 index 0000000..184bd66 --- /dev/null +++ b/sigi/apps/convenios/migrations/0004_auto_20210407_1928.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0001_initial'), + ('convenios', '0003_auto_20210406_1945'), + ] + + operations = [ + migrations.CreateModel( + name='StatusConvenio', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('nome', models.CharField(max_length=100)), + ('cancela', models.BooleanField(default=False, verbose_name='Cancela o conv\xeanio')), + ], + options={ + 'ordering': ('nome',), + 'verbose_name': 'Estado de convenios', + 'verbose_name_plural': 'Estados de convenios', + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='convenio', + name='acompanha', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='acompanhado por', blank=True, to='servidores.Servidor', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='convenio', + name='status', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='estado atual', blank=True, to='convenios.StatusConvenio', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='\xf3rg\xe3o conveniado', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='data_adesao', + field=models.DateField(null=True, verbose_name='aderidas', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='data_retorno_assinatura', + field=models.DateField(help_text='Conv\xeanio firmado.', null=True, verbose_name='conveniadas', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='data_termo_aceite', + field=models.DateField(help_text='Equipamentos recebidos.', null=True, verbose_name='equipadas', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='duracao', + field=models.PositiveIntegerField(help_text='Deixar em branco caso a dura\xe7\xe3o seja indefinida', null=True, verbose_name='dura\xe7\xe3o (meses)', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='observacao', + field=models.TextField(null=True, verbose_name='observa\xe7\xf5es', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/migrations/0005_auto_20210409_0842.py b/sigi/apps/convenios/migrations/0005_auto_20210409_0842.py new file mode 100644 index 0000000..aa0a6d3 --- /dev/null +++ b/sigi/apps/convenios/migrations/0005_auto_20210409_0842.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('convenios', '0004_auto_20210407_1928'), + ] + + operations = [ + migrations.AddField( + model_name='convenio', + name='data_sigad', + field=models.DateField(null=True, verbose_name='data de cadastro no SIGAD', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='convenio', + name='data_sigi', + field=models.DateField(auto_now_add=True, verbose_name='data de cadastro no SIGI', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 59fbb07..9bafc84 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -4,6 +4,7 @@ from datetime import datetime, date from django.db import models from django.utils.translation import ugettext as _ from sigi.apps.utils import SearchField +from sigi.apps.servidores.models import Servidor class Projeto(models.Model): @@ -17,6 +18,17 @@ class Projeto(models.Model): def __unicode__(self): return self.sigla +class StatusConvenio(models.Model): + nome = models.CharField(max_length=100) + cancela = models.BooleanField(_(u"Cancela o convênio"), default=False) + + class Meta: + ordering = ('nome',) + verbose_name = _(u"Estado de convenios") + verbose_name_plural = _(u"Estados de convenios") + + def __unicode__(self): + return self.nome class Convenio(models.Model): @@ -29,8 +41,8 @@ class Convenio(models.Model): um pacto de colaboração entre as partes """ casa_legislativa = models.ForeignKey( - 'casas.CasaLegislativa', - verbose_name=_(u'Casa Legislativa') + 'casas.Orgao', + verbose_name=_(u'órgão conveniado') ) # campo de busca em caixa baixa e sem acentos search_text = SearchField(field_names=['casa_legislativa']) @@ -47,19 +59,49 @@ class Convenio(models.Model): max_length=10, blank=True ) + status = models.ForeignKey( + StatusConvenio, + on_delete=models.SET_NULL, + verbose_name=_(u"estado atual"), + null=True, + blank=True + ) + data_sigad = models.DateField( + _(u"data de cadastro no SIGAD"), + null=True, + blank=True + ) + data_sigi = models.DateField( + _(u"data de cadastro no SIGI"), + blank=True, + null=True, + auto_now_add=True + ) + acompanha = models.ForeignKey( + Servidor, + on_delete=models.SET_NULL, + verbose_name=_(u"acompanhado por"), + null=True, + blank=True + ) + observacao = models.TextField( + _(u"observações"), + null=True, + blank=True, + ) data_adesao = models.DateField( - _(u'Aderidas'), + _(u'aderidas'), null=True, blank=True, ) data_retorno_assinatura = models.DateField( - _(u'Conveniadas'), + _(u'conveniadas'), null=True, blank=True, help_text=_(u'Convênio firmado.') ) duracao = models.PositiveIntegerField( - _(u"Duração (meses)"), + _(u"duração (meses)"), null=True, blank=True, help_text=_(u"Deixar em branco caso a duração seja indefinida") @@ -70,7 +112,7 @@ class Convenio(models.Model): blank=True ) data_termo_aceite = models.DateField( - _(u'Equipadas'), + _(u'equipadas'), null=True, blank=True, help_text=_(u'Equipamentos recebidos.') @@ -98,52 +140,50 @@ class Convenio(models.Model): blank=True, help_text=_(u'Data do retorno do convênio sem assinatura'), ) - observacao = models.CharField( - null=True, - blank=True, - max_length=100, - ) conveniada = models.BooleanField(default=False) equipada = models.BooleanField(default=False) - + def get_termino_convenio(self): if (self.data_retorno_assinatura is None or self.duracao is None): return None - + ano = self.data_retorno_assinatura.year + int(self.duracao / 12) mes = int(self.data_retorno_assinatura.month + int(self.duracao % 12)) if mes > 12: ano = ano + 1 mes = mes - 12 dia = self.data_retorno_assinatura.day - + while True: try: data_fim = date(year=ano, month=mes,day=dia) break except: dia = dia - 1 - + return data_fim - + def get_status(self): + if self.status and self.status.cancela: + return _(u"Cancelado") + if self.data_retorno_assinatura is not None: if self.duracao is not None: if date.today() >= self.get_termino_convenio(): return _(u"Vencido") return _(u"Vigente") - + if (self.data_retorno_assinatura is None and - self.data_devolucao_sem_assinatura is None and + self.data_devolucao_sem_assinatura is None and self.data_retorno_sem_assinatura is None): return _(u"Pendente") if (self.data_devolucao_sem_assinatura is not None or self.data_retorno_sem_assinatura is not None): return _(u"Desistência") - + return _(u"Indefinido") - + def get_sigad_url(self): m = re.match( r'(?P00100|00200)\.(?P\d{6})/(?P\d{4})-\d{2}', @@ -157,7 +197,7 @@ class Convenio(models.Model): r'&txt_numero_ano={ano}"' r' target="_blank">{processo}').format(processo=self.num_processo_sf,**m.groupdict()) return self.num_processo_sf - + def save(self, *args, **kwargs): self.conveniada = self.data_retorno_assinatura is not None self.equipada = self.data_termo_aceite is not None diff --git a/sigi/apps/convenios/templates/convenios/change_list.html b/sigi/apps/convenios/templates/convenios/change_list.html index 3f0ce3e..ccb9607 100644 --- a/sigi/apps/convenios/templates/convenios/change_list.html +++ b/sigi/apps/convenios/templates/convenios/change_list.html @@ -1,19 +1,61 @@ {% extends "change_list_with_cart.html" %} {% load i18n %} -{% block search %} -
    - -
    - - - - - - - - {% trans 'Datas podem ser: Um ano (aaaa), um mês (aaaa-mm) ou um dia (aaaa-mm-dd)' %} +{% block extra_search %} + +{% comment %} + +
    +
    + + + + + + + +
    -{% endblock %} + +{% endcomment %} +{% endblock %} \ No newline at end of file diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index 733dc18..a0a3710 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -11,7 +11,7 @@ from django.template import Context, loader from django.utils.translation import ugettext as _ from geraldo.generators import PDFGenerator -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import UnidadeFederativa from sigi.apps.convenios.models import Convenio, Projeto from sigi.apps.convenios.reports import ConvenioPorCMReport, ConvenioPorALReport, ConvenioReportSemAceiteAL, ConvenioReportSemAceiteCM @@ -249,7 +249,7 @@ def report_regiao(request, regiao='NE'): projetos = Projeto.objects.all() - camaras = CasaLegislativa.objects.filter(tipo__sigla='CM') + camaras = Orgao.objects.filter(tipo__sigla='CM') tabelas = list() # Geral diff --git a/sigi/apps/diagnosticos/forms.py b/sigi/apps/diagnosticos/forms.py index a271a1f..5ff92d5 100644 --- a/sigi/apps/diagnosticos/forms.py +++ b/sigi/apps/diagnosticos/forms.py @@ -11,7 +11,7 @@ from django.utils.translation import ugettext as _ from eav.fields import RangeField from eav.forms import BaseDynamicEntityForm -from sigi.apps.casas.models import CasaLegislativa, Funcionario +from sigi.apps.casas.models import Orgao, Funcionario from sigi.apps.contatos.models import Telefone from sigi.apps.diagnosticos.models import Diagnostico from sigi.apps.diagnosticos.widgets import EavCheckboxSelectMultiple, EavRadioSelect @@ -132,23 +132,23 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm): self.initial[schema.name] = value -class CasaLegislativaMobileForm(forms.ModelForm): +class OrgaoMobileForm(forms.ModelForm): data_instalacao = forms.DateField(label=_(u'Data de instalação da Casa Legislativa'), required=False) data_criacao = forms.DateField() class Meta: - model = CasaLegislativa + model = Orgao fields = ('cnpj', 'data_criacao', 'data_instalacao', 'logradouro', 'bairro', 'cep', 'email', 'pagina_web') def __init__(self, *args, **kwargs): - super(CasaLegislativaMobileForm, self).__init__(*args, **kwargs) + super(OrgaoMobileForm, self).__init__(*args, **kwargs) self.fields['data_criacao'] = forms.DateField( label=_(u'Data de criação do Município'), initial=self.instance.municipio.data_criacao, required=False) def save(self, commit=True): - super(CasaLegislativaMobileForm, self).save(commit=True) + super(OrgaoMobileForm, self).save(commit=True) self.instance.municipio.data_criacao = self.cleaned_data['data_criacao'] if commit: self.instance.municipio.save() diff --git a/sigi/apps/diagnosticos/migrations/0004_auto_20210406_1945.py b/sigi/apps/diagnosticos/migrations/0004_auto_20210406_1945.py new file mode 100644 index 0000000..78a6bd0 --- /dev/null +++ b/sigi/apps/diagnosticos/migrations/0004_auto_20210406_1945.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('diagnosticos', '0003_auto_20201101_2240'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='diagnostico', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/diagnosticos/models.py b/sigi/apps/diagnosticos/models.py index c55739d..bf67c28 100644 --- a/sigi/apps/diagnosticos/models.py +++ b/sigi/apps/diagnosticos/models.py @@ -14,7 +14,7 @@ class Diagnostico(BaseEntity): em uma Casa Legislativa """ casa_legislativa = models.ForeignKey( - 'casas.CasaLegislativa', + 'casas.Orgao', verbose_name=_(u'Casa Legislativa')) # campo de busca em caixa baixa e sem acento diff --git a/sigi/apps/diagnosticos/views.py b/sigi/apps/diagnosticos/views.py index 2807abe..2b4dfba 100644 --- a/sigi/apps/diagnosticos/views.py +++ b/sigi/apps/diagnosticos/views.py @@ -12,7 +12,7 @@ from sigi.apps.casas.models import Funcionario from sigi.apps.contatos.models import Telefone from sigi.apps.diagnosticos.decorators import validate_diagnostico from sigi.apps.diagnosticos.forms import (DiagnosticoMobileForm, - CasaLegislativaMobileForm, FuncionariosMobileForm) + OrgaoMobileForm, FuncionariosMobileForm) from sigi.apps.diagnosticos.models import Diagnostico, Categoria, Pergunta from sigi.apps.diagnosticos.urls import LOGIN_REDIRECT_URL from sigi.apps.utils.decorators import login_required @@ -117,7 +117,7 @@ def categoria_casa_legislativa(request, id_diagnostico): casa_legislativa = diagnostico.casa_legislativa if request.method == "POST": - form = CasaLegislativaMobileForm(request.POST, + form = OrgaoMobileForm(request.POST, instance=casa_legislativa) if form.is_valid(): form.save() @@ -133,7 +133,7 @@ def categoria_casa_legislativa(request, id_diagnostico): json = simplejson.dumps(resposta) return HttpResponse(json, content_type='application/json') else: - form = CasaLegislativaMobileForm(instance=casa_legislativa) + form = OrgaoMobileForm(instance=casa_legislativa) context = RequestContext(request, {'form': form, 'diagnostico': diagnostico, 'casa_legislativa': casa_legislativa}) diff --git a/sigi/apps/eventos/migrations/0005_auto_20210406_1945.py b/sigi/apps/eventos/migrations/0005_auto_20210406_1945.py new file mode 100644 index 0000000..17694f0 --- /dev/null +++ b/sigi/apps/eventos/migrations/0005_auto_20210406_1945.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('eventos', '0004_remove_evento_curso_moodle_id'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='convite', + name='casa', + field=models.ForeignKey(verbose_name='Casa convidada', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='evento', + name='casa_anfitria', + field=models.ForeignKey(verbose_name='Casa anfitri\xe3', blank=True, to='casas.Orgao', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/eventos/models.py b/sigi/apps/eventos/models.py index 721c63e..b678a62 100644 --- a/sigi/apps/eventos/models.py +++ b/sigi/apps/eventos/models.py @@ -3,18 +3,18 @@ from django.db import models from django.utils.functional import lazy from django.utils.translation import ugettext as _ -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import Municipio from sigi.apps.servidores.models import Servidor from django.core.exceptions import ValidationError class TipoEvento(models.Model): nome = models.CharField(_(u"Nome"), max_length=100) - + class Meta: ordering = ("nome",) verbose_name, verbose_name_plural = _(u"Tipo de evento"), _(u"Tipos de evento") - + def __unicode__(self): return self.nome @@ -33,7 +33,7 @@ class Evento(models.Model): solicitante = models.CharField(_(u"Solicitante"), max_length=100) data_inicio = models.DateField(_(u"Data de início")) data_termino = models.DateField(_(u"Data de término")) - casa_anfitria = models.ForeignKey(CasaLegislativa, verbose_name=_(u"Casa anfitriã"), blank=True, + casa_anfitria = models.ForeignKey(Orgao, verbose_name=_(u"Casa anfitriã"), blank=True, null=True) municipio = models.ForeignKey(Municipio) local = models.TextField(_(u"Local do evento"), blank=True) @@ -41,58 +41,58 @@ class Evento(models.Model): status = models.CharField(_(u"Status"), max_length=1, choices=STATUS_CHOICES) data_cancelamento = models.DateField(_(u"Data de cancelamento"), blank=True, null=True) motivo_cancelamento = models.TextField(_(u"Motivo do cancelamento"), blank=True) - + class Meta: ordering = ("-data_inicio",) verbose_name, verbose_name_plural = _(u"Evento"), _(u"Eventos") - + def __unicode__(self): return _("%(nome)s (%(tipo_evento)s): de %(data_inicio)s a %(data_termino)s") % dict( nome=self.nome, tipo_evento=unicode(self.tipo_evento), data_inicio=self.data_inicio, data_termino=self.data_termino) - - def save(self, *args, **kwargs): + + def save(self, *args, **kwargs): if self.status != 'C': self.data_cancelamento = None self.motivo_cancelamento = "" if self.data_inicio > self.data_termino: raise ValidationError(_(u"Data de término deve ser posterior à data de início")) return super(Evento, self).save(*args, **kwargs) - + class Funcao(models.Model): nome = models.CharField(_(u"Função na equipe de evento"), max_length=100) descricao = models.TextField(_(u"Descrição da função")) - + class Meta: ordering = ("nome",) verbose_name, verbose_name_plural = _(u"Função"), _(u"Funções") - + def __unicode__(self): return self.nome - + class Equipe(models.Model): evento = models.ForeignKey(Evento) membro = models.ForeignKey(Servidor, related_name="equipe_evento") funcao = models.ForeignKey(Funcao, verbose_name=_(u"Função na equipe")) observacoes = models.TextField(_(u"Observações"), blank=True) - + class Meta: ordering = ('evento', 'funcao', 'membro',) verbose_name, verbose_name_plural = _(u"Membro da equipe"), _(u"Membros da equipe") - + def __unicode__(self): return u"%s (%s)" % (unicode(self.membro), unicode(self.funcao),) - + class Convite(models.Model): evento = models.ForeignKey(Evento) - casa = models.ForeignKey(CasaLegislativa, verbose_name=_(u"Casa convidada")) + casa = models.ForeignKey(Orgao, verbose_name=_(u"Casa convidada")) servidor = models.ForeignKey(Servidor, verbose_name=_(u"Servidor que convidou")) data_convite = models.DateField(_(u"Data do convite")) aceite = models.BooleanField(_("Aceitou o convite"), default=False) participou = models.BooleanField(_(u"Participou do evento"), default=False) - + class Meta: ordering = ('evento', 'casa', '-data_convite') unique_together = ('evento', 'casa') diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index afc56ae..4f7c310 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -8,15 +8,17 @@ main_menu: url: contatos/unidadefederativa/ - title: Mesorregiões url: contatos/mesorregiao/ - - title: Casas Legislativas - url: casas/casalegislativa/ + - title: Casas e órgãos + url: casas/orgao/ children: - - title: Todas - url: casas/casalegislativa/ + - title: Todo legislativo + url: casas/orgao/?tipo__legislativo__exact=1 - title: Câmaras Municipais - url: casas/casalegislativa/?tipo__id__exact=1 + url: casas/orgao/?tipo__sigla__exact=CM - title: Assembléias Legislativas - url: casas/casalegislativa/?tipo__id__exact=2 + url: casas/orgao/?tipo__sigla__exact=AL + - title: Demais órgãos + url: casas/orgao/?tipo__legislativo__exact=0 - title: Organizar relacionamentos url: casas/portfolio/ - title: Carteira de relacionamentos @@ -50,6 +52,8 @@ main_menu: url: convenios/convenio/ - title: Planos diretores url: metas/planodiretor/ + - title: Tabela de acompanhamento + url: convenios/statusconvenio/ # - title: Inventário # url: inventario/bem/ # children: diff --git a/sigi/apps/home/views.py b/sigi/apps/home/views.py index 442f13f..1f6543b 100644 --- a/sigi/apps/home/views.py +++ b/sigi/apps/home/views.py @@ -27,7 +27,7 @@ import calendar from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from itertools import cycle -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.convenios.models import Convenio, Projeto from sigi.apps.diagnosticos.models import Diagnostico from sigi.apps.metas.models import Meta @@ -58,7 +58,7 @@ def resumo_convenios(request): def resumo_seit(request): mes = request.GET.get('mes', None) ano = request.GET.get('ano', None) - + try: mes = datetime.date(year=int(ano), month=int(mes), day=1) tabela_resumo_seit = busca_informacoes_seit(mes) @@ -73,21 +73,21 @@ def resumo_seit(request): def chart_seit(request): mes = request.GET.get('mes', None) ano = request.GET.get('ano', None) - + try: mes = datetime.date(year=int(ano), month=int(mes), day=1) tabela_resumo_seit = busca_informacoes_seit(mes) except: tabela_resumo_seit = busca_informacoes_seit() - + data = { 'type': 'line', 'prevlink': reverse('home_chartseit') + ('?ano=%s&mes=%s' % (tabela_resumo_seit['mes_anterior'].year, - tabela_resumo_seit['mes_anterior'].month)), + tabela_resumo_seit['mes_anterior'].month)), 'nextlink': reverse('home_chartseit') + ('?ano=%s&mes=%s' % (tabela_resumo_seit['proximo_mes'].year, - tabela_resumo_seit['proximo_mes'].month)), + tabela_resumo_seit['proximo_mes'].month)), 'options': {'bezierCurve': False, 'datasetFill': False, 'pointDot': False, 'responsive': True}, 'data': { 'labels': ['%02d/%s' % (mes.month, mes.year) for mes in reversed(tabela_resumo_seit['meses'])], @@ -100,7 +100,7 @@ def chart_seit(request): for servico in tabela_resumo_seit['servicos']], } } - + return JsonResponse(data) @never_cache @@ -123,19 +123,19 @@ def chart_carteira(request): colors, highlights = color_palete() data = {'type': 'pie', 'options': {'responsive': True}, - 'data': [{'value': r['total_casas'], + 'data': [{'value': r['total_casas'], 'color': colors.next(), 'highlight': highlights.next(), 'label': r['gerentes_interlegis__nome_completo'] } - for r in CasaLegislativa.objects.exclude( + for r in Orgao.objects.exclude( gerentes_interlegis=None).values( 'gerentes_interlegis__nome_completo').annotate( total_casas=Count('pk')).order_by( 'gerentes_interlegis__nome_completo') ] } - + return JsonResponse(data) @never_cache @@ -144,11 +144,11 @@ def chart_performance(request): servidor = request.GET.get('servidor', None) if servidor is None: - casas = CasaLegislativa.objects.exclude(gerentes_interlegis=None) + casas = Orgao.objects.exclude(gerentes_interlegis=None) else: gerente = get_object_or_404(Servidor, pk=servidor) casas = gerente.casas_que_gerencia - + data = { 'type': 'pie', 'options': {'responsive': True}, @@ -184,14 +184,14 @@ def report_sem_convenio(request): casas = sc['total'] titulo = _(u"Casas sem convenio que utilizam algum serviço de registro " u"e/ou hospedagem") - + if fmt == 'csv': response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename=casas.csv' writer = csv.writer(response) writer.writerow([titulo.encode('utf8')]) writer.writerow([u'']) - writer.writerow([u'casa', u'uf', u'gerentes', + writer.writerow([u'casa', u'uf', u'gerentes', u'serviços'.encode('utf8')]) for casa in casas: writer.writerow([ @@ -221,14 +221,14 @@ def report_sem_convenio(request): else: context = {'casas': casas, 'titulo': titulo} return render_to_pdf('home/sem_convenio.html', context) - - + + def busca_informacoes_camara(): """ Busca informacoes no banco para montar tabela de resumo de camaras por projeto Retorna um dicionario de listas """ - camaras = CasaLegislativa.objects.filter(tipo__sigla='CM') + camaras = Orgao.objects.filter(tipo__sigla='CM') convenios = Convenio.objects.filter(casa_legislativa__tipo__sigla='CM') projetos = Projeto.objects.all() @@ -297,7 +297,7 @@ def busca_informacoes_camara(): # Unindo as duas listass para que o cabecalho da esquerda fique junto com sua # respectiva linha lista_zip = zip(cabecalho_esquerda, linhas) - + # Retornando listas em forma de dicionario return { 'cabecalho_topo': cabecalho_topo, @@ -309,10 +309,10 @@ def busca_informacoes_camara(): def sem_convenio(): - total = CasaLegislativa.objects.exclude(servico=None).filter(servico__data_desativacao=None, convenio=None).order_by('municipio__uf__sigla', 'nome').distinct('municipio__uf__sigla', 'nome') - hospedagem = CasaLegislativa.objects.exclude(servico=None).filter(servico__data_desativacao=None, servico__tipo_servico__modo='H', convenio=None).order_by('municipio__uf__sigla', 'nome').distinct('municipio__uf__sigla', 'nome') + total = Orgao.objects.exclude(servico=None).filter(servico__data_desativacao=None, convenio=None).order_by('municipio__uf__sigla', 'nome').distinct('municipio__uf__sigla', 'nome') + hospedagem = Orgao.objects.exclude(servico=None).filter(servico__data_desativacao=None, servico__tipo_servico__modo='H', convenio=None).order_by('municipio__uf__sigla', 'nome').distinct('municipio__uf__sigla', 'nome') reg_keys = set(total.values_list('pk', flat=True)).difference(set(hospedagem.values_list('pk', flat=True))) - registro = CasaLegislativa.objects.filter(pk__in=reg_keys).order_by('municipio__uf__sigla', 'nome') + registro = Orgao.objects.filter(pk__in=reg_keys).order_by('municipio__uf__sigla', 'nome') return { 'total': total, 'hospedagem': hospedagem, @@ -342,13 +342,13 @@ def busca_informacoes_seit(mes_atual=None): mes_atual = datetime.date.today().replace(day=1) mes_anterior = mes_atual - datetime.timedelta(days=1) proximo_mes = mes_atual + datetime.timedelta(days=calendar.monthrange(mes_atual.year, mes_atual.month)[1]) - + meses = [] mes = mes_atual for i in range(1, 13): meses.append(mes) mes = (mes - datetime.timedelta(days=1)).replace(day=1) - + result = { 'mes_atual': mes_atual, 'mes_anterior': mes_anterior, @@ -360,7 +360,7 @@ def busca_informacoes_seit(mes_atual=None): 'Novas casas em %s/%s' % (mes_atual.month, mes_atual.year) ], 'servicos': [], - } + } for tipo_servico in TipoServico.objects.all(): por_mes = [] @@ -374,7 +374,7 @@ def busca_informacoes_seit(mes_atual=None): 'novos_mes_anterior': tipo_servico.servico_set.filter(data_ativacao__year=mes_anterior.year, data_ativacao__month=mes_anterior.month).count(), 'novos_mes_atual': tipo_servico.servico_set.filter(data_ativacao__year=mes_atual.year, data_ativacao__month=mes_atual.month).count(), 'novos_por_mes': por_mes, - 'cor': colors.next(), + 'cor': colors.next(), } ) @@ -410,5 +410,5 @@ def color_palete(): '#B3B6F1', '#BB9098', '#BDF1ED', ]) - + return (colors, highlights) diff --git a/sigi/apps/inventario/migrations/0002_auto_20210406_1945.py b/sigi/apps/inventario/migrations/0002_auto_20210406_1945.py new file mode 100644 index 0000000..0473f66 --- /dev/null +++ b/sigi/apps/inventario/migrations/0002_auto_20210406_1945.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('inventario', '0001_initial'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='bem', + name='casa_legislativa', + field=models.ForeignKey(to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/inventario/models.py b/sigi/apps/inventario/models.py index e86a5e0..cdb67cc 100644 --- a/sigi/apps/inventario/models.py +++ b/sigi/apps/inventario/models.py @@ -72,7 +72,7 @@ class Equipamento(models.Model): class Bem(models.Model): - casa_legislativa = models.ForeignKey('casas.CasaLegislativa') + casa_legislativa = models.ForeignKey('casas.Orgao') equipamento = models.ForeignKey(Equipamento) fornecedor = models.ForeignKey(Fornecedor) num_serie = models.CharField( diff --git a/sigi/apps/metas/migrations/0002_auto_20210406_1945.py b/sigi/apps/metas/migrations/0002_auto_20210406_1945.py new file mode 100644 index 0000000..c590ad0 --- /dev/null +++ b/sigi/apps/metas/migrations/0002_auto_20210406_1945.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('metas', '0001_initial'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='planodiretor', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/metas/models.py b/sigi/apps/metas/models.py index 3ca3c36..e7d5a90 100644 --- a/sigi/apps/metas/models.py +++ b/sigi/apps/metas/models.py @@ -3,7 +3,7 @@ from datetime import date from django.db import models from django.utils.translation import ugettext as _ -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.convenios.models import Projeto, Convenio from sigi.apps.diagnosticos.models import Diagnostico from sigi.apps.financeiro.models import Desembolso @@ -115,7 +115,7 @@ class PlanoDiretor(models.Model): ('I', _(u'Implantado')), ) projeto = models.ForeignKey(Projeto, verbose_name=_(u'Projeto')) - casa_legislativa = models.ForeignKey(CasaLegislativa, verbose_name=_(u'Casa Legislativa')) + casa_legislativa = models.ForeignKey(Orgao, verbose_name=_(u'Casa Legislativa')) casa_legislativa.casa_uf_filter = True status = models.CharField(_(u'Status'), max_length=1, choices=STATUS_CHOICE, default='E') data_entrega = models.DateField(_(u'Data de entrega'), blank=True, null=True) diff --git a/sigi/apps/metas/templatetags/mapa_tags.py b/sigi/apps/metas/templatetags/mapa_tags.py index 79039a6..273176a 100644 --- a/sigi/apps/metas/templatetags/mapa_tags.py +++ b/sigi/apps/metas/templatetags/mapa_tags.py @@ -2,7 +2,7 @@ from django import template from django.utils.safestring import mark_safe -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.metas.views import parliament_summary @@ -11,7 +11,7 @@ register = template.Library() @register.filter(name='map_desc_serv') def descricao_servicos(casa): - if not isinstance(casa, CasaLegislativa): + if not isinstance(casa, Orgao): return "" summary = parliament_summary(casa) diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index f2f9ff4..0cf636c 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -17,7 +17,7 @@ from django.utils.translation import ugettext as _ from django.views.decorators.cache import cache_page from easy_thumbnails.templatetags.thumbnail import thumbnail_url -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import UnidadeFederativa from sigi.apps.convenios.models import Projeto from sigi.apps.financeiro.models import Desembolso @@ -76,7 +76,7 @@ def mapa(request): [(x.sigla, x.sigla, x.nome, True) for x in TipoServico.objects.all()]), ("convenios", _(u'Por Casas conveniadas'), - [(x.sigla, + [(x.sigla, 'convenio_' + x.sigla, _(u'ao {projeto}').format(projeto=x.sigla), x.sigla == 'PML') for x in projetos]), @@ -128,9 +128,9 @@ def map_search(request): q = request.GET.get('q') if len(q.split(',')) > 1: municipio, uf = [s.strip() for s in q.split(',')] - casas = CasaLegislativa.objects.filter(search_text__icontains=to_ascii(municipio), municipio__uf__sigla__iexact=uf) + casas = Orgao.objects.filter(search_text__icontains=to_ascii(municipio), municipio__uf__sigla__iexact=uf) else: - casas = CasaLegislativa.objects.filter(search_text__icontains=to_ascii(q)) + casas = Orgao.objects.filter(search_text__icontains=to_ascii(q)) if casas.count() > 0: response = {'result': 'FOUND', 'ids': [c.pk for c in casas]} @@ -225,11 +225,11 @@ def map_list(request): srv = {x[0]: x[1] for x in TipoServico.objects.values_list('id', 'nome')} cnv = {x[0]: x[1] for x in Projeto.objects.values_list('id', 'sigla')} - - head = [s.encode('utf-8') for s in + + head = [s.encode('utf-8') for s in [u'código IBGE', u'nome da casa', u'município', u'UF', u'região', ] + [x for x in srv.values()] + - reduce(lambda x, y: x + y, + reduce(lambda x, y: x + y, [['conveniada ao %s' % x, 'equipada por %s' % x] for x in cnv.values()])] writer.writerow(head) @@ -240,7 +240,7 @@ def map_list(request): casa.municipio.nome.encode('utf-8'), casa.municipio.uf.sigla.encode('utf-8'), casa.municipio.uf.get_regiao_display().encode('utf-8'), ] - + for id in srv.keys(): try: sv = casa.servico_set.get(tipo_servico__id=id) @@ -286,27 +286,27 @@ def filtrar_casas(seit, convenios, equipadas, regioes, estados, diagnosticos, qConvenio = Q(convenio__projeto__sigla__in=convenios) qEquipada = Q(convenio__projeto__sigla__in=equipadas, convenio__equipada=True) - + qRegiao = Q(municipio__uf__regiao__in=regioes) qEstado = Q(municipio__uf__sigla__in=estados) - + if gerentes: qGerente = Q(gerentes_interlegis__id__in=gerentes) else: qGerente = Q() if diagnosticos: - qDiagnostico = Q(diagnostico__publicado__in=[p == 'P' + qDiagnostico = Q(diagnostico__publicado__in=[p == 'P' for p in diagnosticos]) else: qDiagnostico = Q() - - casas = CasaLegislativa.objects.filter(qRegiao | qEstado).filter(qGerente) - + + casas = Orgao.objects.filter(qRegiao | qEstado).filter(qGerente) + if seit or convenios or equipadas or diagnosticos: casas = casas.filter(qServico | qConvenio | qEquipada | qDiagnostico) else: - casas = casas.filter(Q(servico=None) & Q(convenio=None) & + casas = casas.filter(Q(servico=None) & Q(convenio=None) & Q(diagnostico=None)) return casas @@ -323,7 +323,7 @@ def gera_map_data_file(cronjob=False): casas = {} - for c in CasaLegislativa.objects.prefetch_related('servico_set', 'convenio_set', 'diagnostico_set').all().distinct(): + for c in Orgao.objects.prefetch_related('servico_set', 'convenio_set', 'diagnostico_set').all().distinct(): # if c.servico_set.count() == 0 and c.convenio_set.count() == 0 and c.diagnostico_set.count() == 0: # continue # # Salta essa casa, pois ela não tem nada com o Interlegis @@ -369,7 +369,7 @@ def parliament_summary(parliament): 'equipadas': [], 'info': [] } - + if parliament.gerentes_interlegis.exists(): summary['info'].append(_(u"Gerentes Interlegis: {lista}").format( lista=parliament.lista_gerentes(fmt='lista'))) @@ -378,14 +378,14 @@ def parliament_summary(parliament): summary['info'].append( _(u"{name} ativado em {date}").format( name=sv.tipo_servico.nome, - date=sv.data_ativacao.strftime('%d/%m/%Y') if sv.data_ativacao + date=sv.data_ativacao.strftime('%d/%m/%Y') if sv.data_ativacao else _(u'')) + (u" ").format(sv.url, STATIC_URL)) summary['seit'].append(sv.tipo_servico.sigla) for cv in parliament.convenio_set.all(): - if ((cv.data_retorno_assinatura is None) and + if ((cv.data_retorno_assinatura is None) and (cv.equipada and cv.data_termo_aceite is not None)): summary['info'].append( _(u"Equipada em {date} pelo {project}").format( @@ -397,7 +397,7 @@ def parliament_summary(parliament): _(u"Adesão ao projeto {project}, em {date}").format( project=cv.projeto.sigla, date=cv.data_adesao)) summary['convenios'].append(cv.projeto.sigla) - if ((cv.data_retorno_assinatura is not None) and not + if ((cv.data_retorno_assinatura is not None) and not (cv.equipada and cv.data_termo_aceite is not None)): summary['info'].append( _(u"Conveniada ao %(project)s em %(date)s").format( @@ -421,8 +421,8 @@ def parliament_summary(parliament): _(u"Diagnosticada no período de {initial_date} " u"a {final_date}").format( initial_date=dg.data_visita_inicio.strftime('%d/%m/%Y') - if dg.data_visita_inicio is not None - else _(u""), + if dg.data_visita_inicio is not None + else _(u""), final_date=dg.data_visita_fim.strftime('%d/%m/%Y') if dg.data_visita_fim else _(u""))) diff --git a/sigi/apps/ocorrencias/migrations/0003_auto_20210406_1945.py b/sigi/apps/ocorrencias/migrations/0003_auto_20210406_1945.py new file mode 100644 index 0000000..03ef359 --- /dev/null +++ b/sigi/apps/ocorrencias/migrations/0003_auto_20210406_1945.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ocorrencias', '0002_auto_20160308_0828'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='ocorrencia', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/ocorrencias/models.py b/sigi/apps/ocorrencias/models.py index 2bfe120..0774147 100644 --- a/sigi/apps/ocorrencias/models.py +++ b/sigi/apps/ocorrencias/models.py @@ -34,7 +34,7 @@ class Ocorrencia(models.Model): STATUS_RESOLVIDO = 3 STATUS_FECHADO = 4 STATUS_DUPLICADO = 5 - + STATUS_CHOICES = ( (STATUS_ABERTO , _(u'Aberto')), (STATUS_REABERTO , _(u'Reaberto')), @@ -51,7 +51,7 @@ class Ocorrencia(models.Model): (5, _(u'Baixíssimo')), ) - casa_legislativa = models.ForeignKey('casas.CasaLegislativa', verbose_name=_(u'Casa Legislativa')) + casa_legislativa = models.ForeignKey('casas.Orgao', verbose_name=_(u'Casa Legislativa')) casa_legislativa.convenio_uf_filter = True casa_legislativa.convenio_cl_tipo_filter = True data_criacao = models.DateField(_(u'Data de criação'), null=True, blank=True, auto_now_add=True) @@ -80,7 +80,7 @@ class Ocorrencia(models.Model): if self.ticket is not None and Ocorrencia.objects.exclude(pk=self.pk).filter(ticket=self.ticket).exists(): raise ValidationError({'ticket': _(u"Já existe ocorrência registrada para este ticket")}) return super(Ocorrencia, self).clean() - + def get_ticket_url(self): return mark_safe(settings.OSTICKET_URL % self.ticket) @@ -91,7 +91,7 @@ class Comentario(models.Model): usuario = models.ForeignKey('servidores.Servidor', verbose_name=_(u'Usuário')) novo_status = models.IntegerField(_(u'Novo status'), choices=Ocorrencia.STATUS_CHOICES, blank=True, null=True) encaminhar_setor = models.ForeignKey('servidores.Servico', verbose_name=_(u'Encaminhar para setor'), blank=True, null=True) - + def save(self, *args, **kwargs): if self.encaminhar_setor and (self.encaminhar_setor != self.ocorrencia.setor_responsavel): self.ocorrencia.setor_responsavel = self.encaminhar_setor diff --git a/sigi/apps/ocorrencias/views.py b/sigi/apps/ocorrencias/views.py index 640fc4c..d5d8296 100644 --- a/sigi/apps/ocorrencias/views.py +++ b/sigi/apps/ocorrencias/views.py @@ -8,7 +8,7 @@ from django.views.decorators.http import require_POST from django.template.loader import render_to_string from django.template import RequestContext from sigi.apps.utils import to_ascii -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import UnidadeFederativa from sigi.apps.servidores.models import Servidor, Servico from sigi.apps.ocorrencias.models import Ocorrencia, Anexo @@ -20,33 +20,33 @@ def painel_ocorrencias(request): tipo = request.GET.get('type', None) id = request.GET.get('id', None) painel = request.GET.get('painel', None) - + data = {} - + if tipo is None or tipo == 'error': tipo = 'servidor' u = get_object_or_404(Servidor, user=request.user) id = u.pk - + if id is None: raise Http404("id não definido") - + if tipo == 'casa': - casa = get_object_or_404(CasaLegislativa, pk=id) + casa = get_object_or_404(Orgao, pk=id) ocorrencias = casa.ocorrencia_set.all() panel_title = u"{casa}, {uf}".format( casa=casa.nome, uf=casa.municipio.uf.sigla - ) + ) elif tipo == 'servidor': servidor = get_object_or_404(Servidor, pk=id) panel_title = servidor.nome_completo - + paineis = {'gerente': u"Minhas casas", 'servico': u"Meu setor", 'timeline': u"Comentados por mim"} if painel is None: - if CasaLegislativa.objects.filter( + if Orgao.objects.filter( gerentes_interlegis=servidor).count() > 0: painel = 'gerente' elif Ocorrencia.objects.filter( @@ -54,10 +54,10 @@ def painel_ocorrencias(request): painel = 'servico' else: painel = 'timeline' - + data.update({'paineis': paineis, 'painel': painel, 'servidor': servidor}) - + if painel == 'gerente': ocorrencias = Ocorrencia.objects.filter( casa_legislativa__gerentes_interlegis=servidor) @@ -87,7 +87,7 @@ def painel_ocorrencias(request): 'anexo_set' ) ocorrencias = ocorrencias.annotate(total_anexos=Count('anexo')) - + data.update( {'ocorrencias': ocorrencias, 'panel_title': panel_title, @@ -96,7 +96,7 @@ def painel_ocorrencias(request): 'PRIORITY_CHOICES': Ocorrencia.PRIORITY_CHOICES } ) - + return render(request, 'ocorrencias/painel.html', data) @login_required @@ -106,22 +106,22 @@ def busca_nominal(request, origin="tudo"): return JsonResponse([{'label': _(u'Erro na pesquisa por termo'), 'value': 'type=error'}], safe=False) data = [] - - if origin == "casa" or origin == "tudo": - casas = CasaLegislativa.objects.filter(search_text__icontains=to_ascii(term)).select_related('municipio', 'municipio__uf')[:10] + + if origin == "casa" or origin == "tudo": + casas = Orgao.objects.filter(search_text__icontains=to_ascii(term)).select_related('municipio', 'municipio__uf')[:10] data += [{'value': c.pk, 'label': "%s, %s" % (c.nome, c.municipio.uf.sigla,), 'origin': 'casa'} for c in casas] - - if origin == "servidor" or origin == "tudo": + + if origin == "servidor" or origin == "tudo": servidores = Servidor.objects.filter(nome_completo__icontains=term)[:10] data += [{'value': s.pk, 'label': s.nome_completo, 'origin': 'servidor'} for s in servidores] - + if origin == "servico" or origin == "tudo": setores = Servico.objects.filter(nome__icontains=term) | Servico.objects.filter(sigla__icontains=term) setores = setores[:10] data += [{'value': s.pk, 'label': '%s - %s' % (s.sigla, s.nome), 'origin': 'servico'} for s in setores] - + data = sorted(data, key=lambda d: d['label']) - + return JsonResponse(data, safe=False) @login_required @@ -129,44 +129,44 @@ def busca_nominal(request, origin="tudo"): def muda_prioridade(request): id_ocorrencia = request.POST.get('id_ocorrencia', None) prioridade = request.POST.get('prioridade', None) - + if id_ocorrencia is None or prioridade is None: return JsonResponse({'result': 'error', 'message': _(u'Erro nos parâmetros')}) - + if not any([int(prioridade) == p[0] for p in Ocorrencia.PRIORITY_CHOICES]): return JsonResponse({'result': 'error', 'message': _(u'Valor de prioridade não aceito')}) - + try: ocorrencia = Ocorrencia.objects.get(pk=id_ocorrencia) except Exception as e: return JsonResponse({'result': 'error', 'message': str(e)}) - + ocorrencia.prioridade = prioridade ocorrencia.save() - + return JsonResponse({'result': 'success', 'message': _(u'Prioridade alterada')}) @login_required def exclui_anexo(request): anexo_id = request.GET.get('anexo_id', None) - + if anexo_id is None: return JsonResponse({'result': 'error', 'message': _(u'Erro nos parâmetros')}) - + try: anexo = Anexo.objects.get(pk=anexo_id) except Exception as e: return JsonResponse({'result': 'error', 'message': str(e)}) - + ocorrencia = anexo.ocorrencia anexo.delete() - + link_label = (ungettext('%s arquivo anexo', '%s arquivos anexos', ocorrencia.anexo_set.count()) % (ocorrencia.anexo_set.count(),)) painel = render_to_string('ocorrencias/anexos_snippet.html', {'ocorrencia': ocorrencia}, context_instance=RequestContext(request)) - + return JsonResponse({'result': 'success', 'message': _(u'Anexo %s excluído com sucesso' % (anexo_id,)), 'link_label': link_label, 'anexos_panel': painel}) @@ -176,7 +176,7 @@ def inclui_anexo(request): form = AnexoForm(request.POST, request.FILES) if form.is_valid(): anexo = form.save() - return HttpResponse('' % + return HttpResponse('' % escape(anexo.ocorrencia_id)) else: ocorrencia = form.instance.ocorrencia @@ -186,7 +186,7 @@ def inclui_anexo(request): form = AnexoForm(instance=Anexo(ocorrencia=ocorrencia)) return render(request, 'ocorrencias/anexo_form.html', {'form': form, 'ocorrencia': ocorrencia, 'is_popup': True}) - + @login_required def anexo_snippet(request): ocorrencia_id = request.GET.get('ocorrencia_id', None) @@ -205,19 +205,19 @@ def inclui_comentario(request): form = ComentarioForm() else: ocorrencia = form.instance.ocorrencia - + painel = render_to_string('ocorrencias/ocorrencia_snippet.html', {'ocorrencia': ocorrencia, 'comentario_form': form,}, context_instance=RequestContext(request)) - + return JsonResponse({'ocorrencia_id': ocorrencia.id, 'ocorrencia_panel': painel}) @login_required @require_POST def inclui_ocorrencia(request): form = OcorrenciaForm(request.POST) - + data = {} - + if form.is_valid(): ocorrencia = form.save(commit=False) ocorrencia.servidor_registro = Servidor.objects.get(user=request.user) @@ -230,9 +230,9 @@ def inclui_ocorrencia(request): context_instance=RequestContext(request)) else: data['result'] = 'error' - + data['ocorrencia_form'] = render_to_string('ocorrencias/ocorrencia_form.html', {'ocorrencia_form': form}, context_instance=RequestContext(request)) - + return JsonResponse(data) \ No newline at end of file diff --git a/sigi/apps/parlamentares/migrations/0002_auto_20210406_1945.py b/sigi/apps/parlamentares/migrations/0002_auto_20210406_1945.py new file mode 100644 index 0000000..b645ba0 --- /dev/null +++ b/sigi/apps/parlamentares/migrations/0002_auto_20210406_1945.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0001_initial'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='legislatura', + name='casa_legislativa', + field=models.ForeignKey(to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='mesadiretora', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/parlamentares/models.py b/sigi/apps/parlamentares/models.py index 2d80d38..238b62e 100644 --- a/sigi/apps/parlamentares/models.py +++ b/sigi/apps/parlamentares/models.py @@ -2,7 +2,7 @@ from django.db import models from django.utils.translation import ugettext as _ -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao class Partido(models.Model): @@ -82,7 +82,7 @@ class Mandato(models.Model): class Legislatura(models.Model): - casa_legislativa = models.ForeignKey(CasaLegislativa) + casa_legislativa = models.ForeignKey(Orgao) numero = models.PositiveSmallIntegerField(_(u'número legislatura')) data_inicio = models.DateField(_(u'início')) data_fim = models.DateField(_(u'fim')) @@ -174,7 +174,7 @@ class SessaoLegislativa(models.Model): class MesaDiretora(models.Model): casa_legislativa = models.ForeignKey( - 'casas.CasaLegislativa', + 'casas.Orgao', verbose_name=_(u'Casa Legislativa') ) diff --git a/sigi/apps/parlamentares/reports.py b/sigi/apps/parlamentares/reports.py index adbe021..4e076b0 100644 --- a/sigi/apps/parlamentares/reports.py +++ b/sigi/apps/parlamentares/reports.py @@ -47,7 +47,7 @@ class ParlamentaresLabels(Report): Usage example:: >>> from geraldo.generators import PDFGenerator - >>> queryset = CasaLegislativa.objects.filter(municipio__uf__sigla='MG') + >>> queryset = Orgao.objects.filter(municipio__uf__sigla='MG') >>> report = LabelsReport(queryset) >>> report.generate_by(PDFGenerator, filename='./inline-detail-report.pdf') @@ -268,7 +268,7 @@ def label_text(text): return "%s: " % text -class InfoCasaLegislativa(ReportDefault): +class InfoOrgao(ReportDefault): title = _(u'Casa Legislativa') class band_summary(ReportBand): diff --git a/sigi/apps/parlamentares/views.py b/sigi/apps/parlamentares/views.py index 33d66e4..d7f2090 100644 --- a/sigi/apps/parlamentares/views.py +++ b/sigi/apps/parlamentares/views.py @@ -10,7 +10,7 @@ from django.http import HttpResponse, HttpResponseRedirect from django.views.decorators.csrf import csrf_protect from django.template import RequestContext -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.parlamentares.models import Parlamentar from sigi.apps.parlamentares.reports import ParlamentaresLabels diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 74f5765..9dcb4b9 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -7,8 +7,9 @@ from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ from sigi.apps.casas.admin import FuncionariosInline -from sigi.apps.casas.models import CasaLegislativa -from sigi.apps.servicos.models import Servico, LogServico, CasaAtendida, TipoServico +from sigi.apps.casas.models import Orgao +from sigi.apps.servicos.models import (Servico, LogServico, CasaAtendida, + TipoServico) from sigi.apps.utils.base_admin import BaseModelAdmin @@ -163,7 +164,7 @@ class ServicoAdmin(BaseModelAdmin): if not id_casa: raise Http404 - obj.casa_legislativa = CasaAtendida.objects.get(pk=id_casa) + obj.casa_legislativa = Orgao.objects.get(pk=id_casa) return obj @@ -210,7 +211,7 @@ class CasaAtendidaAdmin(BaseModelAdmin): def change_view(self, request, object_id, extra_context=None): # Se a Casa ainda não é atendida, gerar o código interlegis para ela # Assim ela passa a ser uma casa atendida - casa = CasaLegislativa.objects.get(id=object_id) + casa = Orgao.objects.get(id=object_id) if casa.codigo_interlegis == '': casa.gerarCodigoInterlegis() diff --git a/sigi/apps/servicos/migrations/0004_delete_casaatendida.py b/sigi/apps/servicos/migrations/0004_delete_casaatendida.py new file mode 100644 index 0000000..6e42dc8 --- /dev/null +++ b/sigi/apps/servicos/migrations/0004_delete_casaatendida.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servicos', '0003_auto_20170407_1003'), + ] + + operations = [ + migrations.DeleteModel( + name='CasaAtendida', + ), + ] diff --git a/sigi/apps/servicos/migrations/0005_auto_20210406_1945.py b/sigi/apps/servicos/migrations/0005_auto_20210406_1945.py new file mode 100644 index 0000000..0a86dc2 --- /dev/null +++ b/sigi/apps/servicos/migrations/0005_auto_20210406_1945.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servicos', '0004_delete_casaatendida'), + ('casas', '0014_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='casamanifesta', + name='casa_legislativa', + field=models.OneToOneField(to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='servico', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servicos/migrations/0006_casaatendida.py b/sigi/apps/servicos/migrations/0006_casaatendida.py new file mode 100644 index 0000000..6a58804 --- /dev/null +++ b/sigi/apps/servicos/migrations/0006_casaatendida.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0014_auto_20210406_1945'), + ('servicos', '0005_auto_20210406_1945'), + ] + + operations = [ + migrations.CreateModel( + name='CasaAtendida', + fields=[ + ], + options={ + 'proxy': True, + 'verbose_name_plural': 'Casas atendidas', + }, + bases=('casas.orgao',), + ), + ] diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index 02c228c..74b344e 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -2,7 +2,7 @@ from datetime import date from django.db import models -from sigi.apps.casas.models import CasaLegislativa, Funcionario +from sigi.apps.casas.models import Orgao, Funcionario from django.utils.translation import ugettext as _ @@ -37,7 +37,7 @@ class TipoServico(models.Model): class Servico(models.Model): - casa_legislativa = models.ForeignKey(CasaLegislativa, verbose_name=_(u'Casa Legislativa')) + casa_legislativa = models.ForeignKey(Orgao, verbose_name=_(u'Casa Legislativa')) tipo_servico = models.ForeignKey(TipoServico, verbose_name=_(u'Tipo de serviço')) contato_tecnico = models.ForeignKey(Funcionario, verbose_name=_(u'Contato técnico'), related_name='contato_tecnico', on_delete=models.PROTECT) contato_administrativo = models.ForeignKey(Funcionario, verbose_name=_(u'Contato administrativo'), related_name='contato_administrativo', on_delete=models.PROTECT) @@ -183,7 +183,7 @@ class CasaAtendidaManager(models.Manager): return qs -class CasaAtendida(CasaLegislativa): +class CasaAtendida(Orgao): class Meta: proxy = True @@ -193,7 +193,7 @@ class CasaAtendida(CasaLegislativa): class CasaManifesta(models.Model): - casa_legislativa = models.OneToOneField(CasaLegislativa) + casa_legislativa = models.OneToOneField(Orgao) data_manifestacao = models.DateTimeField(auto_now_add=True) data_atualizacao = models.DateTimeField(auto_now=True) informante = models.CharField(_(u'Nome do informante'), max_length=100, blank=True) @@ -219,4 +219,4 @@ class RegistroServico(models.Model): class Meta: verbose_name_plural = _(u'Registro de serviços') - + diff --git a/sigi/apps/servicos/templates/admin/servicos/casaatendida/change_list.html b/sigi/apps/servicos/templates/admin/servicos/casaatendida/change_list.html index 11d0569..104fd94 100644 --- a/sigi/apps/servicos/templates/admin/servicos/casaatendida/change_list.html +++ b/sigi/apps/servicos/templates/admin/servicos/casaatendida/change_list.html @@ -15,7 +15,7 @@ function dismissRelatedLookupPopup(win, chosenId) { {% block object-tools-items %}
  • + href="{% url 'admin:casas_orgao_changelist' %}?codigo_interlegis__exact=" class="addlink"> {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
  • diff --git a/sigi/apps/servicos/views.py b/sigi/apps/servicos/views.py index ab7a47c..d49bcd9 100644 --- a/sigi/apps/servicos/views.py +++ b/sigi/apps/servicos/views.py @@ -10,9 +10,10 @@ from django.template.context import RequestContext from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateView -from sigi.apps.casas.models import CasaLegislativa +from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import UnidadeFederativa -from sigi.apps.servicos.models import TipoServico, CasaAtendida, CasaManifesta, ServicoManifesto +from sigi.apps.servicos.models import (TipoServico, CasaManifesta, CasaAtendida, + ServicoManifesto) class MapaView(TemplateView): @@ -75,7 +76,7 @@ class CasaManifestaProtoForm(forms.Form): def casa_manifesta_view(request): if 'casa_id' in request.GET: casa_id = request.GET.get('casa_id') - casa = get_object_or_404(CasaLegislativa, pk=casa_id) + casa = get_object_or_404(Orgao, pk=casa_id) # Criar um formulário dinâmico @@ -138,7 +139,7 @@ def casa_manifesta_view(request): extra_context = {'casa': casa, 'cmf': cmf} elif 'uf' in request.GET: uf = request.GET.get('uf') - extra_context = {'casa_list': CasaLegislativa.objects.filter(municipio__uf__sigla=uf)} + extra_context = {'casa_list': Orgao.objects.filter(municipio__uf__sigla=uf)} else: extra_context = {'uf_list': UnidadeFederativa.objects.all()} diff --git a/sigi/test_cart.py b/sigi/test_cart.py index d9d7d53..eb4df2f 100644 --- a/sigi/test_cart.py +++ b/sigi/test_cart.py @@ -8,7 +8,7 @@ from sigi.testutils import pdf_text @pytest.mark.parametrize("url, some_entries, form_action, name_attr, verbose_name_plural", [ ('/parlamentares/parlamentar/', some_parliamentarians, 'adiciona_parlamentar', 'nome_completo', 'Parlamentares'), - ('/casas/casalegislativa/', some_parliaments, 'adicionar_casas', 'nome', 'Casas Legislativas'), + ('/casas/orgao/', some_parliaments, 'adicionar_casas', 'nome', 'Casas Legislativas'), ]) def test_add_to_cart(url, some_entries, form_action, name_attr, verbose_name_plural, app): @@ -41,7 +41,7 @@ def test_add_to_cart(url, some_entries, form_action, name_attr, verbose_name_plu @pytest.mark.parametrize("url, some_entries, all_expression", [ ('/parlamentares/parlamentar/', some_parliamentarians, 'todos os parlamentares', ), - ('/casas/casalegislativa/', some_parliaments, 'todas as casas', ), + ('/casas/orgao/', some_parliaments, 'todas as casas', ), ]) def test_no_selection_brings_everyone_to_the_cart(url, some_entries, all_expression, app): @@ -56,7 +56,7 @@ def test_no_selection_brings_everyone_to_the_cart(url, some_entries, all_express @pytest.mark.parametrize("url, generate_entries", [ ('/parlamentares/parlamentar/', parliamentarians_from_names, ), - ('/casas/casalegislativa/', parliaments_from_names, ), + ('/casas/orgao/', parliaments_from_names, ), ]) def test_pagination(url, generate_entries, app, live_server): diff --git a/templates/admin/change_list.html b/templates/admin/change_list.html index 5dbbabb..f1a7f8a 100644 --- a/templates/admin/change_list.html +++ b/templates/admin/change_list.html @@ -33,7 +33,6 @@ {% block coltype %}flex{% endblock %} {% block object-tools %} - - {% if cl.has_filters %} {% endif %} {% block search %}{% search_form cl %}{% endblock %} - {% endblock %} {% block content %} +{% block extra_search %}{% endblock %}
    {% csrf_token %} {% if cl.formset.errors %} From af606bf53219ef6d44d05a08ceb0bd2455ef1da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 16 Apr 2021 10:57:07 -0300 Subject: [PATCH 29/69] Fix #28 --- .../migrations/0017_auto_20210416_0841.py | 45 +++++++++++++ sigi/apps/casas/models.py | 15 ++++- .../migrations/0003_auto_20210416_0841.py | 39 +++++++++++ sigi/apps/contatos/models.py | 31 +++++++-- .../migrations/0006_auto_20210416_0841.py | 33 ++++++++++ sigi/apps/convenios/models.py | 35 ++++++++-- .../migrations/0005_auto_20210416_0841.py | 51 +++++++++++++++ sigi/apps/diagnosticos/models.py | 65 ++++++++++++++----- .../migrations/0006_auto_20210416_0841.py | 57 ++++++++++++++++ sigi/apps/eventos/models.py | 53 ++++++++++++--- sigi/apps/financeiro/models.py | 6 +- .../migrations/0003_auto_20210416_0841.py | 39 +++++++++++ sigi/apps/inventario/models.py | 23 +++++-- sigi/apps/metas/models.py | 19 +++++- .../migrations/0004_auto_20210416_0841.py | 57 ++++++++++++++++ sigi/apps/ocorrencias/models.py | 63 +++++++++++++++--- .../migrations/0003_auto_20210416_0841.py | 33 ++++++++++ sigi/apps/parlamentares/models.py | 39 +++++++---- .../migrations/0007_auto_20210416_0841.py | 27 ++++++++ sigi/apps/servicos/models.py | 36 ++++++++-- .../migrations/0002_auto_20210416_0841.py | 33 ++++++++++ sigi/apps/servidores/models.py | 35 +++++++--- 22 files changed, 749 insertions(+), 85 deletions(-) create mode 100644 sigi/apps/casas/migrations/0017_auto_20210416_0841.py create mode 100644 sigi/apps/contatos/migrations/0003_auto_20210416_0841.py create mode 100644 sigi/apps/convenios/migrations/0006_auto_20210416_0841.py create mode 100644 sigi/apps/diagnosticos/migrations/0005_auto_20210416_0841.py create mode 100644 sigi/apps/eventos/migrations/0006_auto_20210416_0841.py create mode 100644 sigi/apps/inventario/migrations/0003_auto_20210416_0841.py create mode 100644 sigi/apps/ocorrencias/migrations/0004_auto_20210416_0841.py create mode 100644 sigi/apps/parlamentares/migrations/0003_auto_20210416_0841.py create mode 100644 sigi/apps/servicos/migrations/0007_auto_20210416_0841.py create mode 100644 sigi/apps/servidores/migrations/0002_auto_20210416_0841.py diff --git a/sigi/apps/casas/migrations/0017_auto_20210416_0841.py b/sigi/apps/casas/migrations/0017_auto_20210416_0841.py new file mode 100644 index 0000000..7f6cc71 --- /dev/null +++ b/sigi/apps/casas/migrations/0017_auto_20210416_0841.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0016_auto_20210407_1559'), + ] + + operations = [ + migrations.AlterField( + model_name='funcionario', + name='casa_legislativa', + field=models.ForeignKey(verbose_name='\xf3rg\xe3o', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='municipio', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='Municipio', blank=True, to='contatos.Municipio', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='orgao', + name='municipio', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Munic\xedpio', to='contatos.Municipio'), + preserve_default=True, + ), + migrations.AlterField( + model_name='orgao', + name='pesquisador', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='Pesquisador', blank=True, to='servidores.Servidor', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='orgao', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Tipo', to='casas.TipoOrgao'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 38548fd..b9ce584 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -51,7 +51,11 @@ class Orgao(models.Model): # Guarda um campo para ser usado em buscas em caixa baixa e sem acento search_text = SearchField(field_names=['nome']) # search_text.projeto_filter = True - tipo = models.ForeignKey(TipoOrgao, verbose_name=_(u"Tipo")) + tipo = models.ForeignKey( + TipoOrgao, + on_delete=models.PROTECT, + verbose_name=_(u"Tipo") + ) cnpj = models.CharField(_(u"CNPJ"), max_length=32, blank=True) observacoes = models.TextField(_(u'observações'), blank=True) horario_funcionamento = models.CharField( @@ -84,6 +88,7 @@ class Orgao(models.Model): municipio = models.ForeignKey( 'contatos.Municipio', + on_delete=models.PROTECT, verbose_name=_(u'Município') ) # municipio.uf_filter = True @@ -108,6 +113,7 @@ class Orgao(models.Model): ) pesquisador = models.ForeignKey( Servidor, + on_delete=models.SET_NULL, verbose_name=_(u"Pesquisador"), null=True, blank=True @@ -350,7 +356,11 @@ class Funcionario(models.Model): ("F", _(u"Feminino")) ] - casa_legislativa = models.ForeignKey(Orgao) + casa_legislativa = models.ForeignKey( + Orgao, + on_delete=models.CASCADE, + verbose_name=_(u"órgão"), + ) nome = models.CharField(_(u'nome completo'), max_length=60, blank=False) # nome.alphabetic_filter = True sexo = models.CharField( @@ -375,6 +385,7 @@ class Funcionario(models.Model): endereco = models.CharField(_(u'Endereço'), max_length=100, blank=True) municipio = models.ForeignKey( Municipio, + on_delete=models.SET_NULL, verbose_name=_(u'Municipio'), null=True, blank=True, diff --git a/sigi/apps/contatos/migrations/0003_auto_20210416_0841.py b/sigi/apps/contatos/migrations/0003_auto_20210416_0841.py new file mode 100644 index 0000000..ac856f1 --- /dev/null +++ b/sigi/apps/contatos/migrations/0003_auto_20210416_0841.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('contatos', '0002_auto_20151104_0810'), + ] + + operations = [ + migrations.AlterField( + model_name='contato', + name='municipio', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='munic\xedpio', blank=True, to='contatos.Municipio', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='endereco', + name='municipio', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='munic\xedpio', blank=True, to='contatos.Municipio', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='municipio', + name='microrregiao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Microrregi\xe3o', blank=True, to='contatos.Microrregiao', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='municipio', + name='uf', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='UF', to='contatos.UnidadeFederativa'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/contatos/models.py b/sigi/apps/contatos/models.py index 9b3becf..200095f 100644 --- a/sigi/apps/contatos/models.py +++ b/sigi/apps/contatos/models.py @@ -51,7 +51,11 @@ class Mesorregiao(models.Model): unique=True, help_text=_(u'Código da mesorregião segundo o IBGE') ) - uf = models.ForeignKey(UnidadeFederativa, verbose_name=_(u'UF')) + uf = models.ForeignKey( + UnidadeFederativa, + on_delete=models.CASCADE, + verbose_name=_(u'UF') + ) nome = models.CharField(_(u"Nome mesorregião"), max_length=100) # Campo de busca em caixa baixa sem acento search_text = SearchField(field_names=['nome']) @@ -62,7 +66,7 @@ class Mesorregiao(models.Model): def __unicode__(self): return self.nome - + class Microrregiao(models.Model): codigo_ibge = models.PositiveIntegerField( _(u'Código IBGE'), @@ -70,7 +74,10 @@ class Microrregiao(models.Model): unique=True, help_text=_(u'Código da microrregião segundo o IBGE') ) - mesorregiao = models.ForeignKey(Mesorregiao) + mesorregiao = models.ForeignKey( + Mesorregiao, + on_delete=models.CASCADE + ) nome = models.CharField(_(u"Nome microrregião"), max_length=100) # Campo de busca em caixa baixa sem acento search_text = SearchField(field_names=['nome']) @@ -92,8 +99,14 @@ class Municipio(models.Model): unique=True, help_text=_(u'Código do município segundo IBGE.') ) - - microrregiao = models.ForeignKey(Microrregiao, verbose_name=_(u'Microrregião'), blank=True, null=True) + + microrregiao = models.ForeignKey( + Microrregiao, + on_delete=models.PROTECT, + verbose_name=_(u'Microrregião'), + blank=True, + null=True + ) # codio designado pelo Tribunal Superior Eleitoral codigo_tse = models.PositiveIntegerField( @@ -104,7 +117,11 @@ class Municipio(models.Model): ) nome = models.CharField(max_length=50) search_text = SearchField(field_names=[_(u'nome'), _(u'uf')]) - uf = models.ForeignKey(UnidadeFederativa, verbose_name=_(u'UF')) + uf = models.ForeignKey( + UnidadeFederativa, + on_delete=models.PROTECT, + verbose_name=_(u'UF') + ) # verdadeiro se o município é capital do estado is_capital = models.BooleanField(_(u'capital'), default=False) populacao = models.PositiveIntegerField(_(u'população')) @@ -200,6 +217,7 @@ class Contato(models.Model): municipio = models.ForeignKey( Municipio, + on_delete=models.SET_NULL, verbose_name=_(u'município'), blank=True, null=True, @@ -291,6 +309,7 @@ class Endereco(models.Model): municipio = models.ForeignKey( Municipio, + on_delete=models.SET_NULL, verbose_name=_(u'município'), blank=True, null=True, diff --git a/sigi/apps/convenios/migrations/0006_auto_20210416_0841.py b/sigi/apps/convenios/migrations/0006_auto_20210416_0841.py new file mode 100644 index 0000000..3698399 --- /dev/null +++ b/sigi/apps/convenios/migrations/0006_auto_20210416_0841.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('convenios', '0005_auto_20210409_0842'), + ] + + operations = [ + migrations.AlterField( + model_name='convenio', + name='casa_legislativa', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='\xf3rg\xe3o conveniado', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='projeto', + field=models.ForeignKey(to='convenios.Projeto', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='tramitacao', + name='unid_admin', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Unidade Administrativa', to='convenios.UnidadeAdministrativa'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 9bafc84..2d5e998 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -42,11 +42,15 @@ class Convenio(models.Model): """ casa_legislativa = models.ForeignKey( 'casas.Orgao', + on_delete=models.PROTECT, verbose_name=_(u'órgão conveniado') ) # campo de busca em caixa baixa e sem acentos search_text = SearchField(field_names=['casa_legislativa']) - projeto = models.ForeignKey(_(u'Projeto')) + projeto = models.ForeignKey( + Projeto, + on_delete=models.PROTECT, + ) # numero designado pelo Senado Federal para o convênio num_processo_sf = models.CharField( _(u'número do processo SF (Senado Federal)'), @@ -227,8 +231,15 @@ class EquipamentoPrevisto(models.Model): disponibilizados para as Casas Legislativas (foi usado na prmeira etapa do programa) """ - convenio = models.ForeignKey(Convenio, verbose_name=_(u'convênio')) - equipamento = models.ForeignKey('inventario.Equipamento') + convenio = models.ForeignKey( + Convenio, + on_delete=models.CASCADE, + verbose_name=_(u'convênio') + ) + equipamento = models.ForeignKey( + 'inventario.Equipamento', + on_delete=models.CASCADE + ) quantidade = models.PositiveSmallIntegerField(default=1) class Meta: @@ -244,7 +255,11 @@ class Anexo(models.Model): """ Modelo para giardar os documentos gerados no processo de convênio """ - convenio = models.ForeignKey(Convenio, verbose_name=_(u'convênio')) + convenio = models.ForeignKey( + Convenio, + on_delete=models.CASCADE, + verbose_name=_(u'convênio') + ) # caminho no sistema para o documento anexo arquivo = models.FileField(upload_to='apps/convenios/anexo/arquivo', max_length=500) descricao = models.CharField(_(u'descrição'), max_length='70') @@ -278,8 +293,16 @@ class Tramitacao(models.Model): """ Modelo para registrar as vias do processo de convênio e a Unidade responsável pelo tramite (ex. colher assinaturas do secretário do senado) """ - convenio = models.ForeignKey(Convenio, verbose_name=_(u'convênio')) - unid_admin = models.ForeignKey(UnidadeAdministrativa, verbose_name=_(u'Unidade Administrativa')) + convenio = models.ForeignKey( + Convenio, + on_delete=models.CASCADE, + verbose_name=_(u'convênio') + ) + unid_admin = models.ForeignKey( + UnidadeAdministrativa, + on_delete=models.PROTECT, + verbose_name=_(u'Unidade Administrativa') + ) data = models.DateField() observacao = models.CharField( _(u'observação'), diff --git a/sigi/apps/diagnosticos/migrations/0005_auto_20210416_0841.py b/sigi/apps/diagnosticos/migrations/0005_auto_20210416_0841.py new file mode 100644 index 0000000..ec1a081 --- /dev/null +++ b/sigi/apps/diagnosticos/migrations/0005_auto_20210416_0841.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('diagnosticos', '0004_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='diagnostico', + name='casa_legislativa', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='diagnostico', + name='responsavel', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='respons\xe1vel', to='servidores.Servidor'), + preserve_default=True, + ), + migrations.AlterField( + model_name='equipe', + name='membro', + field=models.ForeignKey(to='servidores.Servidor', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='escolha', + name='schema_to_open', + field=models.ForeignKey(related_name='abre_por', on_delete=django.db.models.deletion.SET_NULL, verbose_name='pergunta para abrir', blank=True, to='diagnosticos.Pergunta', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='resposta', + name='choice', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='escolha', blank=True, to='diagnosticos.Escolha', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='resposta', + name='schema', + field=models.ForeignKey(related_name='attrs', on_delete=django.db.models.deletion.PROTECT, verbose_name='pergunta', to='diagnosticos.Pergunta'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/diagnosticos/models.py b/sigi/apps/diagnosticos/models.py index bf67c28..44fc90c 100644 --- a/sigi/apps/diagnosticos/models.py +++ b/sigi/apps/diagnosticos/models.py @@ -15,7 +15,9 @@ class Diagnostico(BaseEntity): """ casa_legislativa = models.ForeignKey( 'casas.Orgao', - verbose_name=_(u'Casa Legislativa')) + on_delete=models.PROTECT, + verbose_name=_(u'Casa Legislativa') + ) # campo de busca em caixa baixa e sem acento search_text = SearchField(field_names=['casa_legislativa']) @@ -38,8 +40,11 @@ class Diagnostico(BaseEntity): blank=True, ) - responsavel = models.ForeignKey('servidores.Servidor', - verbose_name=_(u'responsável')) + responsavel = models.ForeignKey( + 'servidores.Servidor', + on_delete=models.PROTECT, + verbose_name=_(u'responsável') + ) class Meta: verbose_name, verbose_name_plural = _(u'diagnóstico'), _(u'diagnósticos') @@ -156,7 +161,11 @@ class Pergunta(BaseSchema): Uma pergunta tem o nome e o tipo da resposta """ - categoria = models.ForeignKey(Categoria, related_name='perguntas') + categoria = models.ForeignKey( + Categoria, + on_delete=models.CASCADE, + related_name='perguntas' + ) def group_choices(self): from django.db import connection, transaction @@ -196,10 +205,20 @@ class Escolha(BaseChoice): """ Perguntas de multiplas escolhas tem as opções cadastradas neste modelo """ - schema = models.ForeignKey(Pergunta, - related_name='choices', verbose_name=_(u'pergunta')) - schema_to_open = models.ForeignKey(Pergunta, related_name='abre_por', - verbose_name=_(u'pergunta para abrir'), blank=True, null=True) + schema = models.ForeignKey( + Pergunta, + on_delete=models.CASCADE, + related_name='choices', + verbose_name=_(u'pergunta') + ) + schema_to_open = models.ForeignKey( + Pergunta, + on_delete=models.SET_NULL, + related_name='abre_por', + verbose_name=_(u'pergunta para abrir'), + blank=True, + null=True + ) ordem = models.PositiveIntegerField(blank=True, null=True) class Meta: @@ -212,10 +231,19 @@ class Resposta(BaseAttribute): """ Modelo para guardar as respostas das perguntas de um diagnosico """ - schema = models.ForeignKey(Pergunta, related_name='attrs', - verbose_name=_(u'pergunta')) - choice = models.ForeignKey(Escolha, verbose_name=_(u'escolha'), - blank=True, null=True) + schema = models.ForeignKey( + Pergunta, + on_delete=models.PROTECT, + related_name='attrs', + verbose_name=_(u'pergunta') + ) + choice = models.ForeignKey( + Escolha, + on_delete=models.PROTECT, + verbose_name=_(u'escolha'), + blank=True, + null=True + ) class Meta: verbose_name, verbose_name_plural = _(u'resposta'), _(u'respostas') @@ -225,8 +253,11 @@ class Equipe(models.Model): """ Modelo que representa a equipe de um diagnóstico """ - diagnostico = models.ForeignKey(Diagnostico) - membro = models.ForeignKey('servidores.Servidor') + diagnostico = models.ForeignKey(Diagnostico, on_delete=models.CASCADE) + membro = models.ForeignKey( + 'servidores.Servidor', + on_delete=models.PROTECT + ) class Meta: verbose_name, verbose_name_plural = _(u'equipe'), _(u'equipe') @@ -240,7 +271,11 @@ class Anexo(models.Model): """ Modelo para representar os documentos levantados no processo de diagnóstico. Podem ser fotos, contratos, etc. """ - diagnostico = models.ForeignKey(Diagnostico, verbose_name=u'diagnóstico') + diagnostico = models.ForeignKey( + Diagnostico, + on_delete=models.CASCADE, + verbose_name=u'diagnóstico' + ) arquivo = models.FileField(upload_to='apps/diagnostico/anexo/arquivo', max_length=500) descricao = models.CharField(_(u'descrição'), max_length='70') data_pub = models.DateTimeField(_(u'data da publicação do anexo'), diff --git a/sigi/apps/eventos/migrations/0006_auto_20210416_0841.py b/sigi/apps/eventos/migrations/0006_auto_20210416_0841.py new file mode 100644 index 0000000..5779175 --- /dev/null +++ b/sigi/apps/eventos/migrations/0006_auto_20210416_0841.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('eventos', '0005_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='convite', + name='casa', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa convidada', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='convite', + name='servidor', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Servidor que convidou', to='servidores.Servidor'), + preserve_default=True, + ), + migrations.AlterField( + model_name='equipe', + name='funcao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Fun\xe7\xe3o na equipe', to='eventos.Funcao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='equipe', + name='membro', + field=models.ForeignKey(related_name='equipe_evento', on_delete=django.db.models.deletion.PROTECT, to='servidores.Servidor'), + preserve_default=True, + ), + migrations.AlterField( + model_name='evento', + name='casa_anfitria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa anfitri\xe3', blank=True, to='casas.Orgao', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='evento', + name='municipio', + field=models.ForeignKey(to='contatos.Municipio', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='evento', + name='tipo_evento', + field=models.ForeignKey(to='eventos.TipoEvento', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + ] diff --git a/sigi/apps/eventos/models.py b/sigi/apps/eventos/models.py index b678a62..8fc11c2 100644 --- a/sigi/apps/eventos/models.py +++ b/sigi/apps/eventos/models.py @@ -27,15 +27,26 @@ class Evento(models.Model): ('C', _(u"Cancelado")) ) - tipo_evento = models.ForeignKey(TipoEvento) + tipo_evento = models.ForeignKey( + TipoEvento, + on_delete=models.PROTECT, + ) nome = models.CharField(_(u"Nome do evento"), max_length=100) descricao = models.TextField(_(u"Descrição do evento")) solicitante = models.CharField(_(u"Solicitante"), max_length=100) data_inicio = models.DateField(_(u"Data de início")) data_termino = models.DateField(_(u"Data de término")) - casa_anfitria = models.ForeignKey(Orgao, verbose_name=_(u"Casa anfitriã"), blank=True, - null=True) - municipio = models.ForeignKey(Municipio) + casa_anfitria = models.ForeignKey( + Orgao, + on_delete=models.PROTECT, + verbose_name=_(u"Casa anfitriã"), + blank=True, + null=True + ) + municipio = models.ForeignKey( + Municipio, + on_delete=models.PROTECT + ) local = models.TextField(_(u"Local do evento"), blank=True) publico_alvo = models.TextField(_(u"Público alvo"), blank=True) status = models.CharField(_(u"Status"), max_length=1, choices=STATUS_CHOICES) @@ -73,9 +84,20 @@ class Funcao(models.Model): return self.nome class Equipe(models.Model): - evento = models.ForeignKey(Evento) - membro = models.ForeignKey(Servidor, related_name="equipe_evento") - funcao = models.ForeignKey(Funcao, verbose_name=_(u"Função na equipe")) + evento = models.ForeignKey( + Evento, + on_delete=models.CASCADE + ) + membro = models.ForeignKey( + Servidor, + on_delete=models.PROTECT, + related_name="equipe_evento" + ) + funcao = models.ForeignKey( + Funcao, + on_delete=models.PROTECT, + verbose_name=_(u"Função na equipe") + ) observacoes = models.TextField(_(u"Observações"), blank=True) class Meta: @@ -86,9 +108,20 @@ class Equipe(models.Model): return u"%s (%s)" % (unicode(self.membro), unicode(self.funcao),) class Convite(models.Model): - evento = models.ForeignKey(Evento) - casa = models.ForeignKey(Orgao, verbose_name=_(u"Casa convidada")) - servidor = models.ForeignKey(Servidor, verbose_name=_(u"Servidor que convidou")) + evento = models.ForeignKey( + Evento, + on_delete=models.CASCADE + ) + casa = models.ForeignKey( + Orgao, + on_delete=models.PROTECT, + verbose_name=_(u"Casa convidada") + ) + servidor = models.ForeignKey( + Servidor, + on_delete=models.PROTECT, + verbose_name=_(u"Servidor que convidou") + ) data_convite = models.DateField(_(u"Data do convite")) aceite = models.BooleanField(_("Aceitou o convite"), default=False) participou = models.BooleanField(_(u"Participou do evento"), default=False) diff --git a/sigi/apps/financeiro/models.py b/sigi/apps/financeiro/models.py index 44b7cae..e0e2061 100644 --- a/sigi/apps/financeiro/models.py +++ b/sigi/apps/financeiro/models.py @@ -6,7 +6,11 @@ from sigi.apps.convenios.models import Projeto class Desembolso(models.Model): - projeto = models.ForeignKey(Projeto, verbose_name=_(u'Projeto')) + projeto = models.ForeignKey( + Projeto, + on_delete=models.CASCADE, + verbose_name=_(u'Projeto') + ) descricao = models.CharField(_(u'Descrição da despesa'), max_length=100) data = models.DateField(_(u'Data do desembolso')) valor_reais = models.DecimalField(_(u'Valor em R$'), max_digits=18, decimal_places=2) diff --git a/sigi/apps/inventario/migrations/0003_auto_20210416_0841.py b/sigi/apps/inventario/migrations/0003_auto_20210416_0841.py new file mode 100644 index 0000000..07c7ee7 --- /dev/null +++ b/sigi/apps/inventario/migrations/0003_auto_20210416_0841.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('inventario', '0002_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='bem', + name='fornecedor', + field=models.ForeignKey(to='inventario.Fornecedor', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='equipamento', + name='fabricante', + field=models.ForeignKey(to='inventario.Fabricante', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='equipamento', + name='modelo', + field=models.ForeignKey(to='inventario.ModeloEquipamento', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='modeloequipamento', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='tipo de equipamento', to='inventario.TipoEquipamento'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/inventario/models.py b/sigi/apps/inventario/models.py index cdb67cc..2018769 100644 --- a/sigi/apps/inventario/models.py +++ b/sigi/apps/inventario/models.py @@ -46,6 +46,7 @@ class TipoEquipamento(models.Model): class ModeloEquipamento(models.Model): tipo = models.ForeignKey( TipoEquipamento, + on_delete=models.PROTECT, verbose_name=_(u'tipo de equipamento') ) modelo = models.CharField(max_length=30) @@ -60,8 +61,14 @@ class ModeloEquipamento(models.Model): class Equipamento(models.Model): - fabricante = models.ForeignKey(Fabricante) - modelo = models.ForeignKey(ModeloEquipamento) + fabricante = models.ForeignKey( + Fabricante, + on_delete=models.PROTECT + ) + modelo = models.ForeignKey( + ModeloEquipamento, + on_delete=models.PROTECT + ) class Meta: unique_together = (('fabricante', 'modelo'),) @@ -72,9 +79,15 @@ class Equipamento(models.Model): class Bem(models.Model): - casa_legislativa = models.ForeignKey('casas.Orgao') - equipamento = models.ForeignKey(Equipamento) - fornecedor = models.ForeignKey(Fornecedor) + casa_legislativa = models.ForeignKey( + 'casas.Orgao', + on_delete=models.CASCADE + ) + equipamento = models.ForeignKey(Equipamento, on_delete=models.CASCADE) + fornecedor = models.ForeignKey( + Fornecedor, + on_delete=models.PROTECT + ) num_serie = models.CharField( _(u'número de série'), max_length=64, diff --git a/sigi/apps/metas/models.py b/sigi/apps/metas/models.py index e7d5a90..c267abf 100644 --- a/sigi/apps/metas/models.py +++ b/sigi/apps/metas/models.py @@ -18,7 +18,12 @@ class Meta(models.Model): ('COUNT_PDIR', _(u'Quantidade de planos diretores')), ('COUNT_CONV', _(u'Quantidade de casas conveniadas')), ) - projeto = models.ForeignKey(Projeto, verbose_name=_(u'Projeto'), help_text=_(u'Projeto ao qual a meta se refere')) + projeto = models.ForeignKey( + Projeto, + on_delete=models.CASCADE, + verbose_name=_(u'Projeto'), + help_text=_(u'Projeto ao qual a meta se refere') + ) titulo = models.CharField(_(u'Título'), max_length=40, help_text=_(u'Título da meta que aparecerá no dashboard')) descricao = models.TextField(_(u'Descrição')) data_inicio = models.DateField(_(u'Data inicial'), help_text=_(u'Início do período de cômputo da meta')) @@ -114,8 +119,16 @@ class PlanoDiretor(models.Model): ('E', _(u'Entregue')), ('I', _(u'Implantado')), ) - projeto = models.ForeignKey(Projeto, verbose_name=_(u'Projeto')) - casa_legislativa = models.ForeignKey(Orgao, verbose_name=_(u'Casa Legislativa')) + projeto = models.ForeignKey( + Projeto, + on_delete=models.CASCADE, + verbose_name=_(u'Projeto') + ) + casa_legislativa = models.ForeignKey( + Orgao, + on_delete=models.CASCADE, + verbose_name=_(u'Casa Legislativa') + ) casa_legislativa.casa_uf_filter = True status = models.CharField(_(u'Status'), max_length=1, choices=STATUS_CHOICE, default='E') data_entrega = models.DateField(_(u'Data de entrega'), blank=True, null=True) diff --git a/sigi/apps/ocorrencias/migrations/0004_auto_20210416_0841.py b/sigi/apps/ocorrencias/migrations/0004_auto_20210416_0841.py new file mode 100644 index 0000000..54ce623 --- /dev/null +++ b/sigi/apps/ocorrencias/migrations/0004_auto_20210416_0841.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('ocorrencias', '0003_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='categoria', + name='setor_responsavel', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Setor respons\xe1vel', to='servidores.Servico'), + preserve_default=True, + ), + migrations.AlterField( + model_name='comentario', + name='encaminhar_setor', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Encaminhar para setor', blank=True, to='servidores.Servico', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='comentario', + name='usuario', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Usu\xe1rio', to='servidores.Servidor'), + preserve_default=True, + ), + migrations.AlterField( + model_name='ocorrencia', + name='categoria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Categoria', to='ocorrencias.Categoria'), + preserve_default=True, + ), + migrations.AlterField( + model_name='ocorrencia', + name='servidor_registro', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Servidor que registrou a ocorr\xeancia', to='servidores.Servidor'), + preserve_default=True, + ), + migrations.AlterField( + model_name='ocorrencia', + name='setor_responsavel', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Setor respons\xe1vel', to='servidores.Servico'), + preserve_default=True, + ), + migrations.AlterField( + model_name='ocorrencia', + name='tipo_contato', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Tipo de contato', to='ocorrencias.TipoContato'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/ocorrencias/models.py b/sigi/apps/ocorrencias/models.py index 0774147..873f731 100644 --- a/sigi/apps/ocorrencias/models.py +++ b/sigi/apps/ocorrencias/models.py @@ -9,7 +9,11 @@ from django.utils.safestring import mark_safe class Categoria(models.Model): nome = models.CharField(_(u"Categoria"), max_length=50) descricao = models.TextField(_(u'descrição'), blank=True, null=True) - setor_responsavel = models.ForeignKey('servidores.Servico', verbose_name=_(u"Setor responsável")) + setor_responsavel = models.ForeignKey( + 'servidores.Servico', + on_delete=models.PROTECT, + verbose_name=_(u"Setor responsável") + ) class Meta: verbose_name, verbose_name_plural = _(u'Categoria'), _(u'Categorias') @@ -51,13 +55,25 @@ class Ocorrencia(models.Model): (5, _(u'Baixíssimo')), ) - casa_legislativa = models.ForeignKey('casas.Orgao', verbose_name=_(u'Casa Legislativa')) + casa_legislativa = models.ForeignKey( + 'casas.Orgao', + on_delete=models.CASCADE, + verbose_name=_(u'Casa Legislativa') + ) casa_legislativa.convenio_uf_filter = True casa_legislativa.convenio_cl_tipo_filter = True data_criacao = models.DateField(_(u'Data de criação'), null=True, blank=True, auto_now_add=True) data_modificacao = models.DateField(_(u'Data de modificação'), null=True, blank=True, auto_now=True) - categoria = models.ForeignKey(Categoria, verbose_name=_(u'Categoria')) - tipo_contato = models.ForeignKey(TipoContato, verbose_name=_(u"Tipo de contato")) + categoria = models.ForeignKey( + Categoria, + on_delete=models.PROTECT, + verbose_name=_(u'Categoria') + ) + tipo_contato = models.ForeignKey( + TipoContato, + on_delete=models.PROTECT, + verbose_name=_(u"Tipo de contato") + ) assunto = models.CharField(_(u'Assunto'), max_length=200) assunto.grupo_filter = True status = models.IntegerField(_(u'Status'), choices=STATUS_CHOICES, default=1,) @@ -65,8 +81,16 @@ class Ocorrencia(models.Model): prioridade = models.IntegerField(_(u'Prioridade'), choices=PRIORITY_CHOICES, default=3, ) descricao = models.TextField(_(u'descrição'), blank=True,) resolucao = models.TextField(_(u'resolução'), blank=True,) - servidor_registro = models.ForeignKey('servidores.Servidor', verbose_name=_(u"Servidor que registrou a ocorrência")) - setor_responsavel = models.ForeignKey('servidores.Servico', verbose_name=_(u"Setor responsável")) + servidor_registro = models.ForeignKey( + 'servidores.Servidor', + on_delete=models.PROTECT, + verbose_name=_(u"Servidor que registrou a ocorrência") + ) + setor_responsavel = models.ForeignKey( + 'servidores.Servico', + on_delete=models.PROTECT, + verbose_name=_(u"Setor responsável") + ) ticket = models.PositiveIntegerField(_(u'Número do ticket'), blank=True, null=True, help_text=_(u"Número do ticket no osTicket")) class Meta: @@ -85,12 +109,27 @@ class Ocorrencia(models.Model): return mark_safe(settings.OSTICKET_URL % self.ticket) class Comentario(models.Model): - ocorrencia = models.ForeignKey(Ocorrencia, verbose_name=_(u'Ocorrência'), related_name='comentarios') + ocorrencia = models.ForeignKey( + Ocorrencia, + on_delete=models.CASCADE, + verbose_name=_(u'Ocorrência'), + related_name='comentarios' + ) data_criacao = models.DateTimeField(_(u'Data de criação'), null=True, blank=True, auto_now_add=True) descricao = models.TextField(_(u'Descrição'), blank=True, null=True) - usuario = models.ForeignKey('servidores.Servidor', verbose_name=_(u'Usuário')) + usuario = models.ForeignKey( + 'servidores.Servidor', + on_delete=models.PROTECT, + verbose_name=_(u'Usuário') + ) novo_status = models.IntegerField(_(u'Novo status'), choices=Ocorrencia.STATUS_CHOICES, blank=True, null=True) - encaminhar_setor = models.ForeignKey('servidores.Servico', verbose_name=_(u'Encaminhar para setor'), blank=True, null=True) + encaminhar_setor = models.ForeignKey( + 'servidores.Servico', + on_delete=models.PROTECT, + verbose_name=_(u'Encaminhar para setor'), + blank=True, + null=True + ) def save(self, *args, **kwargs): if self.encaminhar_setor and (self.encaminhar_setor != self.ocorrencia.setor_responsavel): @@ -103,7 +142,11 @@ class Comentario(models.Model): class Anexo(models.Model): - ocorrencia = models.ForeignKey(Ocorrencia, verbose_name=_(u'ocorrência')) + ocorrencia = models.ForeignKey( + Ocorrencia, + on_delete=models.CASCADE, + verbose_name=_(u'ocorrência') + ) arquivo = models.FileField(_(u'Arquivo anexado'), upload_to='apps/ocorrencia/anexo/arquivo', max_length=500) descricao = models.CharField(_(u'descrição do anexo'), max_length='70') data_pub = models.DateTimeField(_(u'data da publicação do anexo'), null=True, blank=True, auto_now_add=True) diff --git a/sigi/apps/parlamentares/migrations/0003_auto_20210416_0841.py b/sigi/apps/parlamentares/migrations/0003_auto_20210416_0841.py new file mode 100644 index 0000000..f7d418b --- /dev/null +++ b/sigi/apps/parlamentares/migrations/0003_auto_20210416_0841.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0002_auto_20210406_1945'), + ] + + operations = [ + migrations.AlterField( + model_name='mandato', + name='cargo', + field=models.ForeignKey(to='parlamentares.Cargo', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='membromesadiretora', + name='cargo', + field=models.ForeignKey(to='parlamentares.Cargo', on_delete=django.db.models.deletion.PROTECT), + preserve_default=True, + ), + migrations.AlterField( + model_name='sessaolegislativa', + name='mesa_diretora', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Mesa Diretora', to='parlamentares.MesaDiretora'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/parlamentares/models.py b/sigi/apps/parlamentares/models.py index 238b62e..f9c64fa 100644 --- a/sigi/apps/parlamentares/models.py +++ b/sigi/apps/parlamentares/models.py @@ -59,10 +59,13 @@ class Mandato(models.Model): ('T', _(u'Titular')), ('S', _(u'Suplente')), ) - parlamentar = models.ForeignKey(Parlamentar) - legislatura = models.ForeignKey('parlamentares.Legislatura') - partido = models.ForeignKey(Partido) - cargo = models.ForeignKey('parlamentares.Cargo') + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.CASCADE) + legislatura = models.ForeignKey( + 'parlamentares.Legislatura', + on_delete=models.CASCADE + ) + partido = models.ForeignKey(Partido, on_delete=models.CASCADE) + cargo = models.ForeignKey('parlamentares.Cargo', on_delete=models.PROTECT) inicio_mandato = models.DateField(_(u'início de mandato')) fim_mandato = models.DateField(_(u'fim de mandato')) is_afastado = models.BooleanField( @@ -82,7 +85,7 @@ class Mandato(models.Model): class Legislatura(models.Model): - casa_legislativa = models.ForeignKey(Orgao) + casa_legislativa = models.ForeignKey(Orgao, on_delete=models.CASCADE) numero = models.PositiveSmallIntegerField(_(u'número legislatura')) data_inicio = models.DateField(_(u'início')) data_fim = models.DateField(_(u'fim')) @@ -106,7 +109,7 @@ class Legislatura(models.Model): class Coligacao(models.Model): nome = models.CharField(max_length=50) - legislatura = models.ForeignKey(Legislatura) + legislatura = models.ForeignKey(Legislatura, on_delete=models.CASCADE) numero_votos = models.PositiveIntegerField( _(u'número de votos'), blank=True, @@ -123,8 +126,15 @@ class Coligacao(models.Model): class ComposicaoColigacao(models.Model): - coligacao = models.ForeignKey(Coligacao, verbose_name=_(u'coligação')) - partido = models.ForeignKey('parlamentares.Partido') + coligacao = models.ForeignKey( + Coligacao, + on_delete=models.CASCADE, + verbose_name=_(u'coligação') + ) + partido = models.ForeignKey( + 'parlamentares.Partido', + on_delete=models.CASCADE + ) class Meta: verbose_name = _(u'composição da coligação') @@ -142,9 +152,10 @@ class SessaoLegislativa(models.Model): numero = models.PositiveSmallIntegerField(_(u'número da sessão'), unique=True) mesa_diretora = models.ForeignKey( 'MesaDiretora', + on_delete=models.PROTECT, verbose_name=_(u'Mesa Diretora') ) - legislatura = models.ForeignKey(Legislatura) + legislatura = models.ForeignKey(Legislatura, on_delete=models.CASCADE) tipo = models.CharField( max_length=1, choices=SESSAO_CHOICES, @@ -175,6 +186,7 @@ class SessaoLegislativa(models.Model): class MesaDiretora(models.Model): casa_legislativa = models.ForeignKey( 'casas.Orgao', + on_delete=models.CASCADE, verbose_name=_(u'Casa Legislativa') ) @@ -197,9 +209,12 @@ class Cargo(models.Model): class MembroMesaDiretora(models.Model): - parlamentar = models.ForeignKey('parlamentares.Parlamentar') - cargo = models.ForeignKey(Cargo) - mesa_diretora = models.ForeignKey(MesaDiretora) + parlamentar = models.ForeignKey( + 'parlamentares.Parlamentar', + on_delete=models.CASCADE + ) + cargo = models.ForeignKey(Cargo, on_delete=models.PROTECT) + mesa_diretora = models.ForeignKey(MesaDiretora, on_delete=models.CASCADE) class Meta: ordering = ('parlamentar',) diff --git a/sigi/apps/servicos/migrations/0007_auto_20210416_0841.py b/sigi/apps/servicos/migrations/0007_auto_20210416_0841.py new file mode 100644 index 0000000..4480c55 --- /dev/null +++ b/sigi/apps/servicos/migrations/0007_auto_20210416_0841.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servicos', '0006_casaatendida'), + ] + + operations = [ + migrations.AlterField( + model_name='servico', + name='casa_legislativa', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Casa Legislativa', to='casas.Orgao'), + preserve_default=True, + ), + migrations.AlterField( + model_name='servico', + name='tipo_servico', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='Tipo de servi\xe7o', to='servicos.TipoServico'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index 74b344e..3fe7d36 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -37,10 +37,28 @@ class TipoServico(models.Model): class Servico(models.Model): - casa_legislativa = models.ForeignKey(Orgao, verbose_name=_(u'Casa Legislativa')) - tipo_servico = models.ForeignKey(TipoServico, verbose_name=_(u'Tipo de serviço')) - contato_tecnico = models.ForeignKey(Funcionario, verbose_name=_(u'Contato técnico'), related_name='contato_tecnico', on_delete=models.PROTECT) - contato_administrativo = models.ForeignKey(Funcionario, verbose_name=_(u'Contato administrativo'), related_name='contato_administrativo', on_delete=models.PROTECT) + casa_legislativa = models.ForeignKey( + Orgao, + on_delete=models.PROTECT, + verbose_name=_(u'Casa Legislativa') + ) + tipo_servico = models.ForeignKey( + TipoServico, + on_delete=models.PROTECT, + verbose_name=_(u'Tipo de serviço') + ) + contato_tecnico = models.ForeignKey( + Funcionario, + on_delete=models.PROTECT, + verbose_name=_(u'Contato técnico'), + related_name='contato_tecnico' + ) + contato_administrativo = models.ForeignKey( + Funcionario, + on_delete=models.PROTECT, + verbose_name=_(u'Contato administrativo'), + related_name='contato_administrativo' + ) url = models.URLField(_(u'URL do serviço'), blank=True) hospedagem_interlegis = models.BooleanField(_(u'Hospedagem no Interlegis?'), default=False) nome_servidor = models.CharField(_(u'Hospedado em'), max_length=60, blank=True, @@ -162,7 +180,11 @@ class Servico(models.Model): class LogServico(models.Model): - servico = models.ForeignKey(Servico, verbose_name=_(u'Serviço')) + servico = models.ForeignKey( + Servico, + on_delete=models.CASCADE, + verbose_name=_(u'Serviço') + ) descricao = models.CharField(_(u'Breve descrição da ação'), max_length=60) data = models.DateField(_(u'Data da ação'), default=date.today) log = models.TextField(_(u'Log da ação')) @@ -202,8 +224,8 @@ class CasaManifesta(models.Model): class ServicoManifesto(models.Model): - casa_manifesta = models.ForeignKey(CasaManifesta) - servico = models.ForeignKey(TipoServico) + casa_manifesta = models.ForeignKey(CasaManifesta, on_delete=models.CASCADE) + servico = models.ForeignKey(TipoServico, on_delete=models.CASCADE) url = models.URLField(blank=True) hospedagem_interlegis = models.BooleanField(_(u'Hospedagem no Interlegis?'), default=False) diff --git a/sigi/apps/servidores/migrations/0002_auto_20210416_0841.py b/sigi/apps/servidores/migrations/0002_auto_20210416_0841.py new file mode 100644 index 0000000..a75cb70 --- /dev/null +++ b/sigi/apps/servidores/migrations/0002_auto_20210416_0841.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='servico', + name='responsavel', + field=models.ForeignKey(related_name='chefe', on_delete=django.db.models.deletion.SET_NULL, to='servidores.Servidor', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='servidor', + name='servico', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='servidores.Servico', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='subsecretaria', + name='responsavel', + field=models.ForeignKey(related_name='diretor', on_delete=django.db.models.deletion.SET_NULL, to='servidores.Servidor', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 0b8e8f6..1e00e92 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -14,7 +14,12 @@ class Subsecretaria(models.Model): nome = models.CharField(max_length=250, null=True) sigla = models.CharField(max_length=10, null=True) # servidor responsavel por dirigir a Subsecretaria - responsavel = models.ForeignKey('servidores.Servidor', related_name='diretor', null=True) + responsavel = models.ForeignKey( + 'servidores.Servidor', + on_delete=models.SET_NULL, + related_name='diretor', + null=True + ) class Meta: ordering = ('nome',) @@ -30,9 +35,18 @@ class Servico(models.Model): nome = models.CharField(_(u'Setor'), max_length=250, null=True) sigla = models.CharField(max_length=10, null=True) - subsecretaria = models.ForeignKey(Subsecretaria, null=True) + subsecretaria = models.ForeignKey( + Subsecretaria, + on_delete=models.CASCADE, + null=True + ) # servidor responsavel por chefiar o serviço - responsavel = models.ForeignKey('servidores.Servidor', related_name='chefe', null=True) + responsavel = models.ForeignKey( + 'servidores.Servidor', + on_delete=models.SET_NULL, + related_name='chefe', + null=True + ) class Meta: ordering = ('nome',) @@ -63,7 +77,7 @@ class Servidor(models.Model): ) # usuario responsavel pela autenticação do servidor no sistema - user = models.ForeignKey(User, unique=True) + user = models.ForeignKey(User, on_delete=models.CASCADE, unique=True) nome_completo = models.CharField(max_length=128) apelido = models.CharField(max_length=50, blank=True) # caminho no sistema para arquivo com a imagem @@ -86,7 +100,12 @@ class Servidor(models.Model): blank=True, null=True, ) - servico = models.ForeignKey('servidores.Servico', blank=True, null=True) + servico = models.ForeignKey( + 'servidores.Servico', + on_delete=models.SET_NULL, + blank=True, + null=True + ) matricula = models.CharField(u'matrícula', max_length=25, blank=True, null=True) turno = models.CharField( max_length=1, @@ -170,7 +189,7 @@ class Funcao(models.Model): """ Modelo para guardar o histórico de funções dos servidores no Interlegis """ - servidor = models.ForeignKey(Servidor) + servidor = models.ForeignKey(Servidor, on_delete=models.CASCADE) funcao = models.CharField(max_length=250, null=True) cargo = models.CharField(max_length=250, null=True) inicio_funcao = models.DateField(u'início da função', null=True) @@ -195,7 +214,7 @@ class Licenca(models.Model): """ Modelo que representa as licenças tiradas pelos servidores """ - servidor = models.ForeignKey(Servidor) + servidor = models.ForeignKey(Servidor, on_delete=models.CASCADE) inicio_licenca = models.DateField(u'início da licença') fim_licenca = models.DateField(u'fim da licença') obs = models.TextField(u'observação', blank=True, null=True) @@ -217,7 +236,7 @@ class Ferias(models.Model): """ Modelo que representa as férias tiradas pelos servidores """ - servidor = models.ForeignKey(Servidor) + servidor = models.ForeignKey(Servidor, on_delete=models.CASCADE) inicio_ferias = models.DateField(u'início das férias') fim_ferias = models.DateField(u'fim das férias') obs = models.TextField(u'observação', blank=True, null=True) From b15cecba7883f382605c44aad7934847a4e2de9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 16 Apr 2021 11:02:44 -0300 Subject: [PATCH 30/69] Fix #24 --- sigi/apps/convenios/admin.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index f3b3311..4f46529 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -52,12 +52,8 @@ class ConvenioAdmin(BaseModelAdmin): {'fields': ('status', 'acompanha', 'observacao',)} ), (_(u'Datas'), - {'fields': ('data_adesao', 'data_retorno_assinatura', 'duracao', - 'data_termo_aceite', 'data_pub_diario', - 'data_devolucao_via', 'data_postagem_correio')} - ), - (_(u'Datas - Convenio sem assinatura'), - {'fields': ('data_devolucao_sem_assinatura', 'data_retorno_sem_assinatura',)} + {'fields': ('data_retorno_assinatura', 'duracao', + 'data_pub_diario',)} ), ) readonly_fields = ('data_sigi',) From 49a5ea262ffdc9d494bbb4ce28e003d906577085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 16 Apr 2021 12:51:01 -0300 Subject: [PATCH 31/69] Fix #27 --- sigi/apps/convenios/admin.py | 11 +++-- .../migrations/0007_auto_20210416_0918.py | 40 ++++++++++++++++++ sigi/apps/convenios/models.py | 41 ++++++++++++++----- .../templates/convenios/change_list.html | 6 +++ 4 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 sigi/apps/convenios/migrations/0007_auto_20210416_0918.py diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 4f46529..b55fd90 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -4,7 +4,8 @@ from django.http import HttpResponse, HttpResponseRedirect from django.utils.translation import ugettext as _ from geraldo.generators import PDFGenerator -from sigi.apps.convenios.models import (Projeto, StatusConvenio, Convenio, +from sigi.apps.convenios.models import (Projeto, StatusConvenio, + TipoSolicitacao, Convenio, EquipamentoPrevisto, Anexo, Tramitacao) from sigi.apps.convenios.reports import ConvenioReport from sigi.apps.convenios.views import adicionar_convenios_carrinho @@ -46,10 +47,11 @@ class ConvenioAdmin(BaseModelAdmin): fieldsets = ( (None, {'fields': ('casa_legislativa', 'num_processo_sf', 'num_convenio', - 'projeto', 'data_sigad', 'data_sigi',)} + 'projeto', 'data_sigi',)} ), (_(u"Acompanhamento no gabinete"), - {'fields': ('status', 'acompanha', 'observacao',)} + {'fields': ('data_solicitacao', 'data_sigad', 'tipo_solicitacao', + 'status', 'acompanha', 'observacao',)} ), (_(u'Datas'), {'fields': ('data_retorno_assinatura', 'duracao', @@ -125,6 +127,8 @@ class ConvenioAdmin(BaseModelAdmin): normaliza_data('data_sigad__lte') normaliza_data('data_sigi__gte') normaliza_data('data_sigi__lte') + normaliza_data('data_solicitacao__gte') + normaliza_data('data_solicitacao__lte') request.GET._mutable = False return super(ConvenioAdmin, self).changelist_view( @@ -176,5 +180,6 @@ class EquipamentoPrevistoAdmin(BaseModelAdmin): admin.site.register(Projeto) admin.site.register(StatusConvenio) +admin.site.register(TipoSolicitacao) admin.site.register(Convenio, ConvenioAdmin) admin.site.register(EquipamentoPrevisto, EquipamentoPrevistoAdmin) diff --git a/sigi/apps/convenios/migrations/0007_auto_20210416_0918.py b/sigi/apps/convenios/migrations/0007_auto_20210416_0918.py new file mode 100644 index 0000000..0daaf23 --- /dev/null +++ b/sigi/apps/convenios/migrations/0007_auto_20210416_0918.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('convenios', '0006_auto_20210416_0841'), + ] + + operations = [ + migrations.CreateModel( + name='TipoSolicitacao', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('nome', models.CharField(max_length=100)), + ], + options={ + 'ordering': ('nome',), + 'verbose_name': 'tipo de solicita\xe7\xe3o', + 'verbose_name_plural': 'Tipos de solicita\xe7\xe3o', + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='convenio', + name='data_solicitacao', + field=models.DateField(null=True, verbose_name='data do e-mail de solicita\xe7\xe3o', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='convenio', + name='tipo_solicitacao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, verbose_name='tipo de solicita\xe7\xe3o', blank=True, to='convenios.TipoSolicitacao', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 2d5e998..e7bfa9c 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -6,9 +6,7 @@ from django.utils.translation import ugettext as _ from sigi.apps.utils import SearchField from sigi.apps.servidores.models import Servidor - class Projeto(models.Model): - """ Modelo para representar os projetos do programa Interlegis """ @@ -30,6 +28,17 @@ class StatusConvenio(models.Model): def __unicode__(self): return self.nome +class TipoSolicitacao(models.Model): + nome = models.CharField(max_length=100) + + class Meta: + ordering = ('nome',) + verbose_name = _(u"tipo de solicitação") + verbose_name_plural = _(u"Tipos de solicitação") + + def __unicode__(self): + return self.nome + class Convenio(models.Model): """ Modelo que representa um convênio do Interlegis @@ -63,23 +72,35 @@ class Convenio(models.Model): max_length=10, blank=True ) - status = models.ForeignKey( - StatusConvenio, - on_delete=models.SET_NULL, - verbose_name=_(u"estado atual"), + data_sigi = models.DateField( + _(u"data de cadastro no SIGI"), + blank=True, null=True, - blank=True + auto_now_add=True ) data_sigad = models.DateField( _(u"data de cadastro no SIGAD"), null=True, blank=True ) - data_sigi = models.DateField( - _(u"data de cadastro no SIGI"), + data_solicitacao = models.DateField( + _(u"data do e-mail de solicitação"), + null=True, + blank=True + ) + tipo_solicitacao = models.ForeignKey( + TipoSolicitacao, + on_delete=models.PROTECT, + null=True, blank=True, + verbose_name=_(u"tipo de solicitação") + ) + status = models.ForeignKey( + StatusConvenio, + on_delete=models.SET_NULL, + verbose_name=_(u"estado atual"), null=True, - auto_now_add=True + blank=True ) acompanha = models.ForeignKey( Servidor, diff --git a/sigi/apps/convenios/templates/convenios/change_list.html b/sigi/apps/convenios/templates/convenios/change_list.html index ccb9607..f9aae7b 100644 --- a/sigi/apps/convenios/templates/convenios/change_list.html +++ b/sigi/apps/convenios/templates/convenios/change_list.html @@ -34,6 +34,12 @@
    +
    + + + + +
    From bbce7a026c994d1eda8b8fa651d5fe39d1cf69a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 16 Apr 2021 12:51:35 -0300 Subject: [PATCH 32/69] Fix #29 e outras melhorias --- sigi/apps/home/templatetags/menu_conf.yaml | 95 +++++++++++----------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 4f7c310..7f0d05c 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -1,6 +1,5 @@ main_menu: - title: Municípios - url: contatos/municipio/ children: - title: Municípios url: contatos/municipio/ @@ -9,7 +8,6 @@ main_menu: - title: Mesorregiões url: contatos/mesorregiao/ - title: Casas e órgãos - url: casas/orgao/ children: - title: Todo legislativo url: casas/orgao/?tipo__legislativo__exact=1 @@ -19,12 +17,57 @@ main_menu: url: casas/orgao/?tipo__sigla__exact=AL - title: Demais órgãos url: casas/orgao/?tipo__legislativo__exact=0 - - title: Organizar relacionamentos - url: casas/portfolio/ + - title: Gerência Interlegis + children: - title: Carteira de relacionamentos url: casas/carteira + - title: Organizar relacionamentos + url: casas/portfolio/ + - title: Convênios + children: + - title: Convênios + url: convenios/convenio/ + - title: Planos diretores + url: metas/planodiretor/ + - title: Serviços SEIT + children: + - title: Casas atendidas + url: servicos/casaatendida/ + - title: Lista de serviços + url: servicos/servico/ + - title: Ocorrências + children: + - title: Painel de ocorrências + url: ocorrencias/painel/ + - title: Registro de ocorrências + url: ocorrencias/ocorrencia/?minhas=S&status__in=1,2 + - title: Eventos + children: + - title: Eventos + url: eventos/evento/ + - title: Calendário mensal + url: eventos/calendario + - title: Alocação de equipe + url: eventos/alocacaoequipe/ + - title: Tabelas auxiliares + children: - title: Tipos de órgãos url: casas/tipoorgao/ + - title: Acompanhamento convênios + url: convenios/statusconvenio/ + - title: Tipos de serviço SEIT + url: servicos/tiposervico/ + - title: Categorias de ocorrências + url: ocorrencias/categoria/ + - title: Tipos de contato + url: ocorrencias/tipocontato/ + - title: Tipos de evento + url: eventos/tipoevento/ + - title: Funções na equipe de eventos + url: eventos/funcao/ + + +# Removidos # - title: Legislaturas # url: parlamentares/legislatura/ # children: @@ -45,15 +88,7 @@ main_menu: # url: diagnosticos/mobile/ # - title: Gráficos e estatísticas # url: diagnosticos/graficos - - title: Convênios - url: convenios/convenio/ - children: - - title: Convênios - url: convenios/convenio/ - - title: Planos diretores - url: metas/planodiretor/ - - title: Tabela de acompanhamento - url: convenios/statusconvenio/ + # - title: Inventário # url: inventario/bem/ # children: @@ -80,39 +115,7 @@ main_menu: # url: servidores/ferias/ # - title: Licenças # url: servidores/licenca/ - - title: Serviços SEIT - url: servicos/casaatendida/ - children: - - title: Tipos de serviço - url: servicos/tiposervico/ - - title: Casas atendidas - url: servicos/casaatendida/ - - title: Lista de serviços - url: servicos/servico/ - - title: Ocorrências - url: ocorrencias/ocorrencia/?minhas=S&status__in=1,2 - children: - - title: Painel de ocorrências - url: ocorrencias/painel/ - - title: Registro de ocorrências - url: ocorrencias/ocorrencia/?minhas=S&status__in=1,2 - - title: Tabela de categorias - url: ocorrencias/categoria/ - - title: Tipos de contato - url: ocorrencias/tipocontato/ - - title: Eventos - url: eventos/evento - children: - - title: Eventos - url: eventos/evento/ - - title: Calendário mensal - url: eventos/calendario - - title: Alocação de equipe - url: eventos/alocacaoequipe/ - - title: Tipos de evento - url: eventos/tipoevento/ - - title: Funções na equipe - url: eventos/funcao/ + # - title: Financeiro # url: financeiro/desembolso/ # children: From f0c914326733682e71d0695adeff5f83100d15dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 16 Apr 2021 13:14:47 -0300 Subject: [PATCH 33/69] Fix #30 --- .../convenios/templates/convenios/carrinho.html | 6 +++++- sigi/apps/convenios/views.py | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sigi/apps/convenios/templates/convenios/carrinho.html b/sigi/apps/convenios/templates/convenios/carrinho.html index 0560ec3..9e8cae8 100644 --- a/sigi/apps/convenios/templates/convenios/carrinho.html +++ b/sigi/apps/convenios/templates/convenios/carrinho.html @@ -68,7 +68,11 @@ {% trans 'Relatório por' %}
    • - + + +
    • +
    • +
    • diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index a0a3710..3ae3e97 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -14,7 +14,12 @@ from geraldo.generators import PDFGenerator from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import UnidadeFederativa from sigi.apps.convenios.models import Convenio, Projeto -from sigi.apps.convenios.reports import ConvenioPorCMReport, ConvenioPorALReport, ConvenioReportSemAceiteAL, ConvenioReportSemAceiteCM +from sigi.apps.convenios.reports import (ConvenioReport, + ConvenioReportSemAceite, + ConvenioPorCMReport, + ConvenioPorALReport, + ConvenioReportSemAceiteAL, + ConvenioReportSemAceiteCM) from django.contrib.auth.decorators import login_required @@ -154,7 +159,7 @@ def report(request, id=None): tipo = request.POST['filtro_casa'] if 'data_aceite' in request.POST: data_aceite_has = request.POST['data_aceite'] - # Verifica filtro se é por Assembleia + # filtro adicional pela seleção do usuário if tipo == 'al': qs = qs.filter(casa_legislativa__tipo__sigla='AL') # Verifica se é com data de aceite @@ -162,12 +167,17 @@ def report(request, id=None): report = ConvenioReportSemAceiteAL(queryset=qs) else: report = ConvenioPorALReport(queryset=qs) - else: + elif tipo == 'cm': qs = qs.filter(casa_legislativa__tipo__sigla='CM') if data_aceite_has == 'nao': report = ConvenioReportSemAceiteCM(queryset=qs) else: report = ConvenioPorCMReport(queryset=qs) + else: + if data_aceite_has == 'nao': + report = ConvenioReportSemAceite(queryset=qs) + else: + report = ConvenioReport(queryset=qs) response = HttpResponse(content_type='application/pdf') if report: From aaf8986965c5056b3d7b00215141d46bbcb7b38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Sat, 17 Apr 2021 09:48:02 -0300 Subject: [PATCH 34/69] Fix #23 --- sigi/apps/eventos/admin.py | 42 ++++++++++--------- .../migrations/0007_auto_20210417_0744.py | 38 +++++++++++++++++ sigi/apps/eventos/models.py | 14 +++++++ 3 files changed, 74 insertions(+), 20 deletions(-) create mode 100644 sigi/apps/eventos/migrations/0007_auto_20210417_0744.py diff --git a/sigi/apps/eventos/admin.py b/sigi/apps/eventos/admin.py index 94c6c58..088d82c 100644 --- a/sigi/apps/eventos/admin.py +++ b/sigi/apps/eventos/admin.py @@ -3,17 +3,17 @@ # sigi.apps.eventos.admin # # Copyright (C) 2015 Interlegis -# +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -26,19 +26,22 @@ from sigi.apps.eventos.models import TipoEvento, Funcao, Evento, Equipe, Convite class EventoAdminForm(forms.ModelForm): class Meta: model = Evento - fields = ('tipo_evento', 'nome', 'descricao', 'solicitante', 'data_inicio', 'data_termino', - 'casa_anfitria', 'municipio', 'local', 'publico_alvo', 'status', - 'data_cancelamento', 'motivo_cancelamento', ) - + fields = ('tipo_evento', 'nome', 'descricao', 'virtual', 'solicitante', + 'data_inicio', 'data_termino', 'carga_horaria', + 'casa_anfitria', 'municipio', 'local', 'publico_alvo', + 'status', 'data_cancelamento', 'motivo_cancelamento', ) + def clean(self): cleaned_data = super(EventoAdminForm, self).clean() data_inicio = cleaned_data.get("data_inicio") data_termino = cleaned_data.get("data_termino") - + if data_inicio > data_termino: - raise forms.ValidationError(_(u"Data término deve ser posterior à data inicio"), - code="invalid_period" ) - + raise forms.ValidationError( + _(u"Data término deve ser posterior à data inicio"), + code="invalid_period" + ) + @admin.register(TipoEvento) class TipoEventAdmin(admin.ModelAdmin): search_fields = ('nome',) @@ -47,24 +50,23 @@ class TipoEventAdmin(admin.ModelAdmin): class FuncaoAdmin(admin.ModelAdmin): list_display = ('nome', 'descricao',) search_fields = ('nome', 'descricao',) - + class EquipeInline(admin.TabularInline): model = Equipe - + class ConviteInline(admin.TabularInline): model = Convite raw_id_fields = ('casa',) @admin.register(Evento) class EventoAdmin(admin.ModelAdmin): - form = EventoAdminForm + form = EventoAdminForm date_hierarchy = 'data_inicio' - list_display = ('nome', 'tipo_evento', 'status', 'data_inicio', 'data_termino', 'municipio', - 'solicitante') - list_filter = ('status', 'tipo_evento', 'municipio__uf', 'solicitante') + list_display = ('nome', 'tipo_evento', 'status', 'data_inicio', + 'data_termino', 'municipio', 'solicitante') + list_filter = ('status', 'tipo_evento', 'virtual', 'municipio__uf', + 'solicitante') raw_id_fields = ('casa_anfitria', 'municipio',) search_fields = ('nome', 'tipo_evento__nome', 'casa_anfitria__search_text', 'municipio__search_text', 'solicitante') - inlines = (EquipeInline, ConviteInline) - - + inlines = (EquipeInline, ConviteInline) \ No newline at end of file diff --git a/sigi/apps/eventos/migrations/0007_auto_20210417_0744.py b/sigi/apps/eventos/migrations/0007_auto_20210417_0744.py new file mode 100644 index 0000000..e00c563 --- /dev/null +++ b/sigi/apps/eventos/migrations/0007_auto_20210417_0744.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('eventos', '0006_auto_20210416_0841'), + ] + + operations = [ + migrations.AddField( + model_name='convite', + name='nomes_participantes', + field=models.TextField(help_text='Favor colocar um participante por linha', verbose_name='nome dos participantes', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='convite', + name='qtde_participantes', + field=models.PositiveIntegerField(default=0, verbose_name='n\xfamero de participantes'), + preserve_default=True, + ), + migrations.AddField( + model_name='evento', + name='carga_horaria', + field=models.PositiveIntegerField(default=0, verbose_name='carga hor\xe1ria'), + preserve_default=True, + ), + migrations.AddField( + model_name='evento', + name='virtual', + field=models.BooleanField(default=False, verbose_name='Virtual'), + preserve_default=True, + ), + ] diff --git a/sigi/apps/eventos/models.py b/sigi/apps/eventos/models.py index 8fc11c2..3fcb85f 100644 --- a/sigi/apps/eventos/models.py +++ b/sigi/apps/eventos/models.py @@ -33,9 +33,14 @@ class Evento(models.Model): ) nome = models.CharField(_(u"Nome do evento"), max_length=100) descricao = models.TextField(_(u"Descrição do evento")) + virtual = models.BooleanField(_("Virtual"), default=False) solicitante = models.CharField(_(u"Solicitante"), max_length=100) data_inicio = models.DateField(_(u"Data de início")) data_termino = models.DateField(_(u"Data de término")) + carga_horaria = models.PositiveIntegerField( + _(u"carga horária"), + default=0 + ) casa_anfitria = models.ForeignKey( Orgao, on_delete=models.PROTECT, @@ -125,6 +130,15 @@ class Convite(models.Model): data_convite = models.DateField(_(u"Data do convite")) aceite = models.BooleanField(_("Aceitou o convite"), default=False) participou = models.BooleanField(_(u"Participou do evento"), default=False) + qtde_participantes = models.PositiveIntegerField( + _(u"número de participantes"), + default=0 + ) + nomes_participantes = models.TextField( + _(u"nome dos participantes"), + blank=True, + help_text=_(u"Favor colocar um participante por linha") + ) class Meta: ordering = ('evento', 'casa', '-data_convite') From 17ae196eaa6ae3c554c8c1f37dee5524bc3bc42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 22 Apr 2021 10:14:36 -0300 Subject: [PATCH 35/69] Fix #43 --- sigi/apps/casas/admin.py | 10 +++++----- .../apps/casas/migrations/0018_orgao_sigla.py | 20 +++++++++++++++++++ sigi/apps/casas/models.py | 7 +++++-- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 sigi/apps/casas/migrations/0018_orgao_sigla.py diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 7cd039e..de91b80 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -308,9 +308,9 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): actions = ['adicionar_casas', ] inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, ConveniosInline, ServicoInline, OcorrenciaInline,) - list_display = ('nome', 'get_uf', 'get_gerentes', 'get_convenios', + list_display = ('sigla', 'nome', 'get_uf', 'get_gerentes', 'get_convenios', 'get_servicos') - list_display_links = ('nome',) + list_display_links = ('sigla', 'nome',) list_filter = ('tipo', ('gerentes_interlegis', GerentesInterlegisFilter), 'municipio__uf__nome', ConvenioFilter, ServicoFilter, 'inclusao_digital',) @@ -318,7 +318,7 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): queryset = queryset_ascii fieldsets = ( (None, { - 'fields': ('tipo', 'nome', 'cnpj', 'num_parlamentares', + 'fields': ('tipo', 'nome', 'sigla', 'cnpj', 'num_parlamentares', 'gerentes_interlegis') }), (_(u'Endereço'), { @@ -336,10 +336,10 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): ) raw_id_fields = ('municipio',) readonly_fields = ['num_parlamentares', 'gerentes_interlegis',] - search_fields = ('search_text', 'cnpj', 'bairro', 'logradouro', + search_fields = ('search_text', 'sigla', 'cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') - filter_horizontal = ('gerentes_interlegis',) + # filter_horizontal = ('gerentes_interlegis',) def get_uf(self, obj): return obj.municipio.uf.nome diff --git a/sigi/apps/casas/migrations/0018_orgao_sigla.py b/sigi/apps/casas/migrations/0018_orgao_sigla.py new file mode 100644 index 0000000..fcc6370 --- /dev/null +++ b/sigi/apps/casas/migrations/0018_orgao_sigla.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0017_auto_20210416_0841'), + ] + + operations = [ + migrations.AddField( + model_name='orgao', + name='sigla', + field=models.CharField(max_length=30, verbose_name='sigla do \xf3rg\xe3o', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index b9ce584..4a63403 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -47,10 +47,13 @@ class Orgao(models.Model): max_length=60, help_text=_(u'Exemplo: Câmara Municipal de Pains.') ) - + sigla = models.CharField( + _(u"sigla do órgão"), + max_length=30, + blank=True + ) # Guarda um campo para ser usado em buscas em caixa baixa e sem acento search_text = SearchField(field_names=['nome']) - # search_text.projeto_filter = True tipo = models.ForeignKey( TipoOrgao, on_delete=models.PROTECT, From 883e15b2d41e5be151f0f7d9e2e80f1de80e8337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 23 Apr 2021 08:37:43 -0300 Subject: [PATCH 36/69] Fix #44 --- sigi/apps/convenios/admin.py | 3 + .../migrations/0008_auto_20210422_1907.py | 34 +++ sigi/apps/convenios/models.py | 27 ++- sigi/apps/servidores/admin.py | 98 ++------- .../migrations/0003_auto_20210422_1729.py | 109 ++++++++++ .../migrations/0004_auto_20210422_1907.py | 27 +++ sigi/apps/servidores/models.py | 202 +----------------- .../servidores/servidores_por_cargo.html | 51 ----- .../servidores/servidores_por_funcao.html | 51 ----- sigi/apps/servidores/urls.py | 11 - sigi/apps/servidores/views.py | 34 --- sigi/urls.py | 1 - 12 files changed, 219 insertions(+), 429 deletions(-) create mode 100644 sigi/apps/convenios/migrations/0008_auto_20210422_1907.py create mode 100644 sigi/apps/servidores/migrations/0003_auto_20210422_1729.py create mode 100644 sigi/apps/servidores/migrations/0004_auto_20210422_1907.py delete mode 100644 sigi/apps/servidores/templates/servidores/servidores_por_cargo.html delete mode 100644 sigi/apps/servidores/templates/servidores/servidores_por_funcao.html delete mode 100644 sigi/apps/servidores/urls.py diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index b55fd90..601079d 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -53,6 +53,9 @@ class ConvenioAdmin(BaseModelAdmin): {'fields': ('data_solicitacao', 'data_sigad', 'tipo_solicitacao', 'status', 'acompanha', 'observacao',)} ), + (_(u"Gestão do convênio"), + {'fields': ('servico_gestao', 'servidor_gestao',)} + ), (_(u'Datas'), {'fields': ('data_retorno_assinatura', 'duracao', 'data_pub_diario',)} diff --git a/sigi/apps/convenios/migrations/0008_auto_20210422_1907.py b/sigi/apps/convenios/migrations/0008_auto_20210422_1907.py new file mode 100644 index 0000000..f061a28 --- /dev/null +++ b/sigi/apps/convenios/migrations/0008_auto_20210422_1907.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0004_auto_20210422_1907'), + ('convenios', '0007_auto_20210416_0918'), + ] + + operations = [ + migrations.AddField( + model_name='convenio', + name='servico_gestao', + field=models.ForeignKey(related_name='convenios_geridos', on_delete=django.db.models.deletion.SET_NULL, verbose_name='servi\xe7o de gest\xe3o', blank=True, to='servidores.Servico', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='convenio', + name='servidor_gestao', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='servidor de gest\xe3o', blank=True, to='servidores.Servidor', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='convenio', + name='acompanha', + field=models.ForeignKey(related_name='convenios_acompanhados', on_delete=django.db.models.deletion.SET_NULL, verbose_name='acompanhado por', blank=True, to='servidores.Servidor', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index e7bfa9c..b411171 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -4,7 +4,7 @@ from datetime import datetime, date from django.db import models from django.utils.translation import ugettext as _ from sigi.apps.utils import SearchField -from sigi.apps.servidores.models import Servidor +from sigi.apps.servidores.models import Servidor, Servico class Projeto(models.Model): """ Modelo para representar os projetos do programa @@ -40,15 +40,6 @@ class TipoSolicitacao(models.Model): return self.nome class Convenio(models.Model): - - """ Modelo que representa um convênio do Interlegis - com uma Casa Legislativa. - - Uma Casa Legislativa pode não ter um convênio e sim - apenas uma adesão com o Interlegis, isto é, - não tem compromissos direto com o Interlegis apenas - um pacto de colaboração entre as partes - """ casa_legislativa = models.ForeignKey( 'casas.Orgao', on_delete=models.PROTECT, @@ -105,6 +96,7 @@ class Convenio(models.Model): acompanha = models.ForeignKey( Servidor, on_delete=models.SET_NULL, + related_name='convenios_acompanhados', verbose_name=_(u"acompanhado por"), null=True, blank=True @@ -114,6 +106,21 @@ class Convenio(models.Model): null=True, blank=True, ) + servico_gestao = models.ForeignKey( + Servico, + on_delete=models.SET_NULL, + null=True, + blank=True, + related_name='convenios_geridos', + verbose_name=_(u"serviço de gestão") + ) + servidor_gestao = models.ForeignKey( + Servidor, + on_delete=models.SET_NULL, + null=True, + blank=True, + verbose_name=_(u"servidor de gestão") + ) data_adesao = models.DateField( _(u'aderidas'), null=True, diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index bbf4b7b..e9f912d 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -4,90 +4,30 @@ from django.contrib.contenttypes import generic from django.utils.translation import ugettext as _ from sigi.apps.contatos.models import Endereco, Telefone -from sigi.apps.servidores.forms import FeriasForm, LicencaForm, FuncaoForm -from sigi.apps.servidores.models import Servidor, Funcao, Licenca, Ferias, Servico, Subsecretaria +from sigi.apps.servidores.models import Servidor, Servico from sigi.apps.utils.admin_widgets import AdminImageWidget from sigi.apps.utils.base_admin import BaseModelAdmin from sigi.apps.utils.filters import AlphabeticFilter - -class FuncaoAdmin(BaseModelAdmin): - form = FuncaoForm - list_display = ('servidor', 'funcao', 'cargo', 'inicio_funcao', 'fim_funcao') - list_filter = ('inicio_funcao', 'fim_funcao') - search_fields = ('funcao', 'cargo', 'descricao', - 'servidor__nome_completo', 'servidor__obs', 'servidor__apontamentos', - 'servidor__user__email', 'servidor__user__first_name', - 'servidor__user__last_name', 'servidor__user__username') - - -class FeriasAdmin(BaseModelAdmin): - form = FeriasForm - list_display = ('servidor', 'inicio_ferias', 'fim_ferias') - list_filter = ('inicio_ferias', 'fim_ferias') - search_fields = ('obs', - 'servidor__nome_completo', 'servidor__email_pessoal', - 'servidor__user__email', 'servidor__user__username') - - class ServidorFilter(AlphabeticFilter): title = _(u'Nome do Servidor') parameter_name = 'servidor__nome_completo' +@admin.register(Servico) +class ServicoAdmin(admin.ModelAdmin): + list_display = ['sigla', 'nome', 'subordinado', 'responsavel'] + list_filter = ['subordinado',] + search_fields = ['nome', 'sigla',] -class LicencaAdmin(BaseModelAdmin): - form = LicencaForm - list_display = ('servidor', 'inicio_licenca', 'fim_licenca') - list_filter = (ServidorFilter, 'inicio_licenca', 'fim_licenca') - search_fields = ('obs', - 'servidor__nome_completo', 'servidor__email_pessoal', - 'servidor__user__email', 'servidor__user__username') - - def lookup_allowed(self, lookup, value): - return super(LicencaAdmin, self).lookup_allowed(lookup, value) or \ - lookup in ['servidor__nome_completo'] - - -class EnderecoInline(generic.GenericStackedInline): - model = Endereco - extra = 0 - raw_id_fields = ('municipio',) - - -class TelefonesInline(generic.GenericTabularInline): - extra = 1 - model = Telefone - - +@admin.register(Servidor) class ServidorAdmin(BaseModelAdmin): - - def is_active(self, servidor): - return servidor.user.is_active - is_active.admin_order_field = 'user__is_active' - is_active.boolean = True - is_active.short_description = _(u'ativo') - - list_display = ('nome_completo', 'is_active', 'foto', 'servico', ) - list_filter = ('user__is_active', 'sexo', 'servico',) - search_fields = ('nome_completo', 'obs', 'apontamentos', - 'user__email', 'user__first_name', - 'user__last_name', 'user__username') + list_display = ('foto', 'nome_completo', 'is_active', 'servico', ) + list_filter = ('user__is_active', 'servico',) + search_fields = ('nome_completo', 'user__email', 'user__first_name', + 'user__last_name', 'user__username', 'servico__nome', + 'servico__sigla') raw_id_fields = ('user',) - inlines = (TelefonesInline, EnderecoInline) - fieldsets = ( - (_(u'Autenticação'), { - 'fields': ('user',), - }), - (_(u'Cadastro'), { - 'fields': ('nome_completo', 'foto', 'email_pessoal', 'rg', 'cpf', 'sexo', 'data_nascimento', 'matricula', 'ramal', 'data_nomeacao', 'ato_numero', 'ato_exoneracao') - }), - (_(u'Lotação'), { - 'fields': ('servico', 'turno', 'de_fora'), - }), - (_(u'Observações'), { - 'fields': ('apontamentos', 'obs'), - }), - ) + fields = ['user', 'nome_completo', 'foto', 'servico',] def lookup_allowed(self, lookup, value): return super(ServidorAdmin, self).lookup_allowed(lookup, value) or \ @@ -103,10 +43,8 @@ class ServidorAdmin(BaseModelAdmin): return db_field.formfield(**kwargs) return super(ServidorAdmin, self).formfield_for_dbfield(db_field, **kwargs) - -admin.site.register(Servidor, ServidorAdmin) -admin.site.register(Funcao, FuncaoAdmin) -admin.site.register(Ferias, FeriasAdmin) -admin.site.register(Licenca, LicencaAdmin) -admin.site.register(Servico) -admin.site.register(Subsecretaria) + def is_active(self, servidor): + return servidor.user.is_active + is_active.admin_order_field = 'user__is_active' + is_active.boolean = True + is_active.short_description = _(u'ativo') \ No newline at end of file diff --git a/sigi/apps/servidores/migrations/0003_auto_20210422_1729.py b/sigi/apps/servidores/migrations/0003_auto_20210422_1729.py new file mode 100644 index 0000000..229ed1d --- /dev/null +++ b/sigi/apps/servidores/migrations/0003_auto_20210422_1729.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0002_auto_20210416_0841'), + ] + + operations = [ + migrations.RemoveField( + model_name='ferias', + name='servidor', + ), + migrations.DeleteModel( + name='Ferias', + ), + migrations.RemoveField( + model_name='funcao', + name='servidor', + ), + migrations.DeleteModel( + name='Funcao', + ), + migrations.RemoveField( + model_name='licenca', + name='servidor', + ), + migrations.DeleteModel( + name='Licenca', + ), + migrations.RemoveField( + model_name='subsecretaria', + name='responsavel', + ), + migrations.RemoveField( + model_name='servico', + name='subsecretaria', + ), + migrations.DeleteModel( + name='Subsecretaria', + ), + migrations.RemoveField( + model_name='servidor', + name='apontamentos', + ), + migrations.RemoveField( + model_name='servidor', + name='ato_exoneracao', + ), + migrations.RemoveField( + model_name='servidor', + name='ato_numero', + ), + migrations.RemoveField( + model_name='servidor', + name='cpf', + ), + migrations.RemoveField( + model_name='servidor', + name='data_nascimento', + ), + migrations.RemoveField( + model_name='servidor', + name='data_nomeacao', + ), + migrations.RemoveField( + model_name='servidor', + name='de_fora', + ), + migrations.RemoveField( + model_name='servidor', + name='email_pessoal', + ), + migrations.RemoveField( + model_name='servidor', + name='matricula', + ), + migrations.RemoveField( + model_name='servidor', + name='obs', + ), + migrations.RemoveField( + model_name='servidor', + name='ramal', + ), + migrations.RemoveField( + model_name='servidor', + name='rg', + ), + migrations.RemoveField( + model_name='servidor', + name='sexo', + ), + migrations.RemoveField( + model_name='servidor', + name='turno', + ), + migrations.AddField( + model_name='servico', + name='subordinado', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='subordinado a', to='servidores.Servico', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servidores/migrations/0004_auto_20210422_1907.py b/sigi/apps/servidores/migrations/0004_auto_20210422_1907.py new file mode 100644 index 0000000..364a337 --- /dev/null +++ b/sigi/apps/servidores/migrations/0004_auto_20210422_1907.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0003_auto_20210422_1729'), + ] + + operations = [ + migrations.AlterField( + model_name='servico', + name='responsavel', + field=models.ForeignKey(related_name='chefe', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='servidores.Servidor', null=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='servico', + name='subordinado', + field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='subordinado a', blank=True, to='servidores.Servico', null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 1e00e92..7aff853 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -5,47 +5,22 @@ from django.db import models from django.db.models.signals import post_save from django.utils.translation import ugettext as _ - -class Subsecretaria(models.Model): - - """ Modelo para representação das Subsecretarias do Interlegis - """ - - nome = models.CharField(max_length=250, null=True) - sigla = models.CharField(max_length=10, null=True) - # servidor responsavel por dirigir a Subsecretaria - responsavel = models.ForeignKey( - 'servidores.Servidor', - on_delete=models.SET_NULL, - related_name='diretor', - null=True - ) - - class Meta: - ordering = ('nome',) - - def __unicode__(self): - return '%s (%s)' % (unicode(self.nome), unicode(self.sigla)) - - class Servico(models.Model): - - """ Modelo para representação dos Serviços de uma Subsecretaria - """ - nome = models.CharField(_(u'Setor'), max_length=250, null=True) sigla = models.CharField(max_length=10, null=True) - subsecretaria = models.ForeignKey( - Subsecretaria, - on_delete=models.CASCADE, - null=True + subordinado = models.ForeignKey( + 'self', + on_delete=models.SET_NULL, + null=True, + blank=True, + verbose_name=_(u"subordinado a") ) - # servidor responsavel por chefiar o serviço responsavel = models.ForeignKey( 'servidores.Servidor', on_delete=models.SET_NULL, related_name='chefe', - null=True + null=True, + blank=True ) class Meta: @@ -54,33 +29,12 @@ class Servico(models.Model): verbose_name_plural = _(u'serviços') def __unicode__(self): - return '%s (%s)' % (unicode(self.nome), unicode(self.sigla)) - + return u"{sigla} - {nome}".format(sigla=self.sigla, nome=self.nome) class Servidor(models.Model): - - """ Modelo para representação de um Servidor. - - Um servidor pertence a um Serviço e uma Subsecretaria os campos - deste modelo são referente as informações básicas de cadastro. - """ - - SEXO_CHOICES = ( - ('M', u'Masculino'), - ('F', u'Feminino'), - ) - - TURNO_CHOICES = ( - ('M', u'Manhã'), - ('T', u'Tarde'), - ('N', u'Noite'), - ) - - # usuario responsavel pela autenticação do servidor no sistema user = models.ForeignKey(User, on_delete=models.CASCADE, unique=True) nome_completo = models.CharField(max_length=128) apelido = models.CharField(max_length=50, blank=True) - # caminho no sistema para arquivo com a imagem foto = models.ImageField( upload_to='fotos/servidores', width_field='foto_largura', @@ -89,79 +43,17 @@ class Servidor(models.Model): ) foto_largura = models.SmallIntegerField(editable=False, null=True) foto_altura = models.SmallIntegerField(editable=False, null=True) - sexo = models.CharField( - max_length=1, - choices=SEXO_CHOICES, - blank=True, - null=True, - ) - data_nascimento = models.DateField( - 'data de nascimento', - blank=True, - null=True, - ) servico = models.ForeignKey( - 'servidores.Servico', + Servico, on_delete=models.SET_NULL, blank=True, null=True ) - matricula = models.CharField(u'matrícula', max_length=25, blank=True, null=True) - turno = models.CharField( - max_length=1, - choices=TURNO_CHOICES, - blank=True, - null=True, - ) - de_fora = models.BooleanField(default=False) - data_nomeacao = models.DateField(u'data de nomeação', blank=True, null=True) - ato_exoneracao = models.CharField(u'ato de exoneração', max_length=150, blank=True, null=True) - ato_numero = models.CharField(u'ato de exoneração', max_length=150, blank=True, null=True) - cpf = models.CharField('CPF', max_length=11, blank=True, null=True) - rg = models.CharField('RG', max_length=25, blank=True, null=True) - obs = models.TextField(u'observação', blank=True, null=True) - apontamentos = models.TextField(u'apontamentos', blank=True, null=True) - - # Informações de contato - email_pessoal = models.EmailField('email pessoal', blank=True, null=True) - endereco = generic.GenericRelation('contatos.Endereco') - telefones = generic.GenericRelation('contatos.Telefone') - ramal = models.CharField(max_length=25, blank=True, null=True) class Meta: ordering = ('nome_completo',) verbose_name_plural = 'servidores' - def is_chefe(self): - """ Verifica se o servidor é chefe ou diretor - """ - pass - - def data_entrada(self): - """ Verifica a data de entrada da função mais antiga - """ - pass - - def data_saida(self): - """ Verifica a data de saída da função mais recente - de um servidor desativado - - Caso o usuário esteja ativo retorna None - """ - pass - - @property - def diagnosticos(self): - """ Retorna todos os diagnosticos que este servidor - participa, isto é, como responsavel ou parte da equipe - """ - diagnosticos = set(self.diagnostico_set.filter(publicado=True).all()) - - for equipe in self.equipe_set.all(): - diagnosticos.add(equipe.diagnostico) - - return list(diagnosticos) - def __unicode__(self): return self.nome_completo @@ -172,8 +64,6 @@ User.servidor = property(lambda user: Servidor.objects.get(user=user)) # Sinal para ao criar um usuário criar um servidor # baseado no nome contino no LDAP - - def create_user_profile(sender, instance, created, **kwargs): if created: Servidor.objects.create( @@ -181,74 +71,4 @@ def create_user_profile(sender, instance, created, **kwargs): nome_completo="%s %s" % (instance.first_name, instance.last_name) ) -post_save.connect(create_user_profile, sender=User) - - -class Funcao(models.Model): - - """ Modelo para guardar o histórico de funções dos - servidores no Interlegis - """ - servidor = models.ForeignKey(Servidor, on_delete=models.CASCADE) - funcao = models.CharField(max_length=250, null=True) - cargo = models.CharField(max_length=250, null=True) - inicio_funcao = models.DateField(u'início da função', null=True) - fim_funcao = models.DateField(u'fim da função', blank=True, null=True) - descricao = models.TextField(u'descrição', blank=True, null=True) - - bap_entrada = models.CharField('BAP de entrada', max_length=50, blank=True, null=True) - data_bap_entrada = models.DateField('data BAP de entrada', blank=True, null=True) - - bap_saida = models.CharField(u'BAP de saída', max_length=50, blank=True, null=True) - data_bap_saida = models.DateField(u'data BAP de saída', blank=True, null=True) - - class Meta: - verbose_name = u'função' - verbose_name_plural = u'funções' - - def __unicode__(self): - return str(self.id) - - -class Licenca(models.Model): - - """ Modelo que representa as licenças tiradas pelos servidores - """ - servidor = models.ForeignKey(Servidor, on_delete=models.CASCADE) - inicio_licenca = models.DateField(u'início da licença') - fim_licenca = models.DateField(u'fim da licença') - obs = models.TextField(u'observação', blank=True, null=True) - - class Meta: - verbose_name = u'licença' - verbose_name_plural = u'licenças' - - def days(): - """ Calcula a quantidade de dias da licença - """ - pass - - def __unicode__(self): - return str(self.id) - - -class Ferias(models.Model): - - """ Modelo que representa as férias tiradas pelos servidores - """ - servidor = models.ForeignKey(Servidor, on_delete=models.CASCADE) - inicio_ferias = models.DateField(u'início das férias') - fim_ferias = models.DateField(u'fim das férias') - obs = models.TextField(u'observação', blank=True, null=True) - - class Meta: - verbose_name = u'férias' - verbose_name_plural = u'férias' - - def days(): - """ Calcula a quantidade de dias das férias - """ - pass - - def __unicode__(self): - return str(self.id) +post_save.connect(create_user_profile, sender=User) \ No newline at end of file diff --git a/sigi/apps/servidores/templates/servidores/servidores_por_cargo.html b/sigi/apps/servidores/templates/servidores/servidores_por_cargo.html deleted file mode 100644 index 6c73b84..0000000 --- a/sigi/apps/servidores/templates/servidores/servidores_por_cargo.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "base_report.html" %} -{% load i18n %} - -{% block extra_head %} - -{% endblock %} - -{% block subsecretaria %} -{% trans 'SUBSECRETARIA DE ADMINISTRAÇÃO – SSADM' %} -{% endblock %} - -{% block report %} -
      -

      {% trans 'Relatório de Servidores por Cargo' %}

      -
    {{ casa.nome }}{{ casa.nome }} {{ casa.municipio.uf.get_regiao_display }} {{ casa.municipio.uf }} {{ casa.municipio.microrregiao.mesorregiao }}
    - - - - - - {% for r in report %} - - - - - - {% endfor %} - - - - - -
    {% trans 'Cargo' %}{% trans 'Servidores' %}
    {{ forloop.counter }}{{ r.cargo }}{{ r.cargo__count }}
    {% trans 'Total' %}{{ total }}
    -
    -{% endblock %} diff --git a/sigi/apps/servidores/templates/servidores/servidores_por_funcao.html b/sigi/apps/servidores/templates/servidores/servidores_por_funcao.html deleted file mode 100644 index dcaed72..0000000 --- a/sigi/apps/servidores/templates/servidores/servidores_por_funcao.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "base_report.html" %} -{% load i18n %} - -{% block extra_head %} - -{% endblock %} - -{% block subsecretaria %} -{% trans 'SUBSECRETARIA DE ADMINISTRAÇÃO – SSADM' %} -{% endblock %} - -{% block report %} -
    -

    {% trans 'Relatório de Servidores por Função' %}

    - - - - - - - {% for r in report %} - - - - - - {% endfor %} - - - - - -
    {% trans 'Função' %}{% trans 'Servidores' %}
    {{ forloop.counter }}{{ r.funcao }}{{ r.funcao__count }}
    {% trans 'Total' %}{{ total }}
    -
    -{% endblock %} diff --git a/sigi/apps/servidores/urls.py b/sigi/apps/servidores/urls.py deleted file mode 100644 index 0a3c33c..0000000 --- a/sigi/apps/servidores/urls.py +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8 -*- -from django.conf.urls import patterns, url - - -urlpatterns = patterns( - 'sigi.apps.servidores.views', - - # Reports servidores - url(r'^servidores_por_funcao.pdf$', 'servidores_por_funcao', name='servidores-funcao-pdf'), - url(r'^servidores_por_cargo.pdf$', 'servidores_por_cargo', name='servidores-cargo-pdf'), -) diff --git a/sigi/apps/servidores/views.py b/sigi/apps/servidores/views.py index f229af4..e69de29 100644 --- a/sigi/apps/servidores/views.py +++ b/sigi/apps/servidores/views.py @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- - -import new -from django.template import RequestContext -from django.shortcuts import render_to_response, get_object_or_404, redirect -from django.db.models import Avg, Max, Min, Count -from sigi.apps.servidores.models import Servidor, Funcao -from sigi.shortcuts import render_to_pdf - - -def servidores_por_funcao(request): - report = Funcao.objects.values('funcao').annotate(funcao__count=Count('funcao')).order_by('funcao__count') - total = Funcao.objects.count() - - context = RequestContext(request, { - 'pagesize': 'A4', - 'report': report, - 'total': total - }) - - return render_to_pdf('servidores/servidores_por_funcao.html', context) - - -def servidores_por_cargo(request): - report = Funcao.objects.values('cargo').annotate(cargo__count=Count('cargo')).order_by('cargo__count') - total = Funcao.objects.count() - - context = RequestContext(request, { - 'pagesize': 'A4', - 'report': report, - 'total': total - }) - - return render_to_pdf('servidores/servidores_por_cargo.html', context) diff --git a/sigi/urls.py b/sigi/urls.py index 8ae90e2..7998344 100644 --- a/sigi/urls.py +++ b/sigi/urls.py @@ -15,7 +15,6 @@ urlpatterns = patterns( url(r'^casas/', include('sigi.apps.casas.urls')), url(r'^convenios/', include('sigi.apps.convenios.urls')), url(r'^diagnosticos/', include('sigi.apps.diagnosticos.urls')), - url(r'^servidores/', include('sigi.apps.servidores.urls')), url(r'^servicos/', include('sigi.apps.servicos.urls')), url(r'^dashboard/', include('sigi.apps.metas.urls')), url(r'^ocorrencias/', include('sigi.apps.ocorrencias.urls')), From c2be17e26c44bbe83d67846185a0ecf5874dc539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 23 Apr 2021 11:05:37 -0300 Subject: [PATCH 37/69] Melhora na interface do app servidores --- sigi/apps/servidores/admin.py | 24 ++++++++++++++++++- .../migrations/0005_auto_20210423_0904.py | 18 ++++++++++++++ sigi/apps/servidores/models.py | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 sigi/apps/servidores/migrations/0005_auto_20210423_0904.py diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index e9f912d..5e64ced 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -13,11 +13,33 @@ class ServidorFilter(AlphabeticFilter): title = _(u'Nome do Servidor') parameter_name = 'servidor__nome_completo' +class ServicoFilter(admin.SimpleListFilter): + title = _(u"Subordinados à") + parameter_name = 'subordinado__id__exact' + + def lookups(self, request, model_admin): + return ([('None', _(u"Nenhum"))] + + [(s.id, s.nome) for s in Servico.objects.exclude(servico=None)]) + + def queryset(self, request, queryset): + if self.value(): + if self.value() == "None": + queryset = queryset.filter(subordinado=None) + else: + queryset = queryset.filter(subordinado__id=self.value()) + return queryset + + +class ServicoInline(admin.TabularInline): + model = Servico + fields = ['nome', 'sigla', 'responsavel',] + @admin.register(Servico) class ServicoAdmin(admin.ModelAdmin): list_display = ['sigla', 'nome', 'subordinado', 'responsavel'] - list_filter = ['subordinado',] + list_filter = [ServicoFilter,] search_fields = ['nome', 'sigla',] + inlines = [ServicoInline,] @admin.register(Servidor) class ServidorAdmin(BaseModelAdmin): diff --git a/sigi/apps/servidores/migrations/0005_auto_20210423_0904.py b/sigi/apps/servidores/migrations/0005_auto_20210423_0904.py new file mode 100644 index 0000000..5d0fc81 --- /dev/null +++ b/sigi/apps/servidores/migrations/0005_auto_20210423_0904.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0004_auto_20210422_1907'), + ] + + operations = [ + migrations.AlterModelOptions( + name='servico', + options={'ordering': ('-subordinado__sigla', 'nome'), 'verbose_name': 'servi\xe7o', 'verbose_name_plural': 'servi\xe7os'}, + ), + ] diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 7aff853..48c7128 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -24,7 +24,7 @@ class Servico(models.Model): ) class Meta: - ordering = ('nome',) + ordering = ('-subordinado__sigla', 'nome',) verbose_name = _(u'serviço') verbose_name_plural = _(u'serviços') From 781dcc3bbd7e5ca6f02c51e6c795f9f6793fb78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 29 Apr 2021 11:23:54 -0300 Subject: [PATCH 38/69] Fix #54 --- sigi/apps/casas/forms.py | 6 + sigi/apps/casas/templates/casas/importar.html | 72 ++++++ .../templates/casas/importar_result.html | 18 ++ sigi/apps/casas/urls.py | 4 + sigi/apps/casas/views.py | 236 +++++++++++++++++- templates/admin/base_site.html | 1 + 6 files changed, 333 insertions(+), 4 deletions(-) create mode 100644 sigi/apps/casas/templates/casas/importar.html create mode 100644 sigi/apps/casas/templates/casas/importar_result.html diff --git a/sigi/apps/casas/forms.py b/sigi/apps/casas/forms.py index dca4889..a8396c4 100644 --- a/sigi/apps/casas/forms.py +++ b/sigi/apps/casas/forms.py @@ -6,6 +6,12 @@ from localflavor.br.forms import BRZipCodeField from sigi.apps.casas.models import Orgao from sigi.apps.servidores.models import Servidor +class AtualizaCasaForm(forms.Form): + arquivo = forms.FileField( + required=True, + label=_(u"arquivo a importar"), + help_text=_(u"Envie um arquivo no formato CSV"), + ) class OrgaoForm(forms.ModelForm): # cnpj = BRCNPJField( diff --git a/sigi/apps/casas/templates/casas/importar.html b/sigi/apps/casas/templates/casas/importar.html new file mode 100644 index 0000000..065f1d4 --- /dev/null +++ b/sigi/apps/casas/templates/casas/importar.html @@ -0,0 +1,72 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block content_title %} +

    {% trans 'Importar dados para atualização de órgãos' %}

    +{% endblock %} + +{% block content %} +{% if error %} + +{% endif %} +
    + + {% csrf_token %} +
    + {{ form }} +
    + + +
    +

    Padrões do arquivo:

    +
      +
    • O arquivo deve ter o formato de texto, no padrão CSV
    • +
    • Deve-se usar pt-br.UTF-8 como codificação do arquivo
    • +
    • A primeira linha do arquivo teve conter o cabeçalho das colunas, conforme explicado a seguir
    • +
    • Cada linha subsequente deve referir-se a um e somente um órgão
    • +
    • Campos deixados em branco serão ignorados
    • +
    +
    +

    Colunas do arquivo:

    +
      +
    • O arquivo deve possuir no mínimo as colunas marcadas como obrigatórias. + A primeira linha deve conter os cabeçalhos, que devem ser grafados + EXATAMENTE como descrito na tabela abaixo (minúsculas, sem acentos, sem espaços).
    • +
    • É desejável que as colunas estejam na mesma ordem definida aqui.
    • +
    • Colunas adicionais podem estar presentes, e serão ignoradas
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ObrigatórioTítulo do campoConteúdo esperado
    *tipoDeve conter CM para Câmara Municipal ou AL para Assembleia Legislativa
    *municipioO nome do município. Não use abreviações!!!
    *ufA sigla da Unidade da Federação (Estado) em letras maiúsculas (ex: MG, SP, PA)
    orgao_enderecoO novo endereço do órgão.
    orgao_bairroO novo bairro do órgão
    orgao_cepO novo CEP do órgão
    orgao_emailO novo e-mail institucional do órgão
    orgao_portalO novo endereço do portal institucional do órgão
    orgao_telefonesOs telefones do órgão. Pode conter quantos telefones forem necessários, separando-os por espaço. Use a formatação padrão de telefones, mas não use espaço entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes.
    presidente_nomeO nome completo do presidente
    presidente_data_nascimentoA data de nascimento do presidente no formato DD/MM/AAAA
    presidente_telefonesOs telefones ou whatsapp do presidente. Pode conter quantos telefones forem necessários, separando-os por espaço. Use a formatação padrão de telefones, mas não use espaço entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes.
    presidente_emailsOs e-mails do presidente. Pode conter quantos e-mails forem necessários. Utilize espaço para separar um e-mail do outro
    presidente_enderecoO novo endereço do presidente
    presidente_municipioO nome do município onde mora o presidente
    presidente_bairroO nome do bairro onde mora o presidente
    presidente_cepO novo CEP do presidente
    presidente_redes_sociaisAs redes sociais do presidente. Pode conter quantas redes sociais forem necessárias. Utilize espaço para separar uma rede da outra.
    +
    +
    +{% endblock %} + diff --git a/sigi/apps/casas/templates/casas/importar_result.html b/sigi/apps/casas/templates/casas/importar_result.html new file mode 100644 index 0000000..1b0cda5 --- /dev/null +++ b/sigi/apps/casas/templates/casas/importar_result.html @@ -0,0 +1,18 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block content_title %} +

    Importação de órgãos concluída com {% if com_erros %}erros{% else %}sucesso!{% endif %}

    +{% endblock %} + +{% block content %} +
    +

    {{ total }} registros importados do arquivo {{ file_name }}

    + {% if com_erros %} +

    {{ com_erros }} registros apresentaram erros

    +

    Download do arquivo de erros

    + {% endif %} +

    Importar outro arquivo

    +
    +{% endblock %} + diff --git a/sigi/apps/casas/urls.py b/sigi/apps/casas/urls.py index df6bf9f..f94a467 100644 --- a/sigi/apps/casas/urls.py +++ b/sigi/apps/casas/urls.py @@ -1,5 +1,6 @@ # coding: utf-8 from django.conf.urls import patterns, url +from sigi.apps.casas.views import importa_casas urlpatterns = patterns( @@ -35,4 +36,7 @@ urlpatterns = patterns( url(r'^orgao/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), + + # Atualização por CSV + url(r'^orgao/importa/$', importa_casas.as_view(), name='importar-casas'), ) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 03a6243..0a1642d 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -1,26 +1,254 @@ # -*- coding: utf-8 -*- import csv +from datetime import datetime from functools import reduce from geraldo.generators import PDFGenerator +from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.db.models import Count, Q -from django.http import HttpResponse, HttpResponseRedirect +from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _, ungettext +from django.views.generic import View -from sigi.apps.casas.forms import PortfolioForm -from sigi.apps.casas.models import Orgao, TipoOrgao +from sigi.apps.casas.forms import PortfolioForm, AtualizaCasaForm +from sigi.apps.casas.models import Orgao, TipoOrgao, Funcionario from sigi.apps.casas.reports import (CasasLegislativasLabels, CasasLegislativasLabelsSemPresidente) -from sigi.apps.contatos.models import UnidadeFederativa, Mesorregiao, Microrregiao +from sigi.apps.contatos.models import (UnidadeFederativa, Municipio, + Mesorregiao, Microrregiao) from sigi.apps.ocorrencias.models import Ocorrencia from sigi.apps.parlamentares.reports import ParlamentaresLabels from sigi.apps.servicos.models import TipoServico from sigi.apps.servidores.models import Servidor from sigi.shortcuts import render_to_pdf +class importa_casas(View): + errors = [] + total_registros = 0 + + TIPO = 'tipo' + MUNICIPIO = 'municipio' + UF = 'uf' + ORGAO_ENDERECO = 'orgao_endereco' + ORGAO_BAIRRO = 'orgao_bairro' + ORGAO_CEP = 'orgao_cep' + ORGAO_EMAIL = 'orgao_email' + ORGAO_PORTAL = 'orgao_portal' + ORGAO_TELEFONES = 'orgao_telefones' + PRESIDENTE_NOME = 'presidente_nome' + PRESIDENTE_DATA_NASCIMENTO = 'presidente_data_nascimento' + PRESIDENTE_TELEFONES = 'presidente_telefones' + PRESIDENTE_EMAILS = 'presidente_emails' + PRESIDENTE_ENDERECO = 'presidente_endereco' + PRESIDENTE_MUNICIPIO = 'presidente_municipio' + PRESIDENTE_BAIRRO = 'presidente_bairro' + PRESIDENTE_CEP = 'presidente_cep' + PRESIDENTE_REDES_SOCIAIS = 'presidente_redes_sociais' + ERROS = 'erros_importacao' + + fieldnames = [TIPO, MUNICIPIO, UF, ORGAO_ENDERECO, ORGAO_BAIRRO, ORGAO_CEP, + ORGAO_EMAIL, ORGAO_PORTAL, ORGAO_TELEFONES, PRESIDENTE_NOME, + PRESIDENTE_DATA_NASCIMENTO, PRESIDENTE_TELEFONES, + PRESIDENTE_EMAILS, PRESIDENTE_ENDERECO, PRESIDENTE_MUNICIPIO, + PRESIDENTE_BAIRRO, PRESIDENTE_CEP, PRESIDENTE_REDES_SOCIAIS, + ERROS,] + + ID_FIELDS = {TIPO, MUNICIPIO, UF} + + ORGAO_FIELDS = { + ORGAO_ENDERECO: 'logradouro', + ORGAO_BAIRRO: 'bairro', + ORGAO_CEP: 'cep', + ORGAO_EMAIL: 'email', + ORGAO_PORTAL: 'pagina_web', + ORGAO_TELEFONES: 'telefones', + } + + PRESIDENTE_FIELDS = { + PRESIDENTE_NOME: 'nome', + PRESIDENTE_DATA_NASCIMENTO: 'data_nascimento', + PRESIDENTE_TELEFONES: 'nota', + PRESIDENTE_EMAILS: 'email', + PRESIDENTE_ENDERECO: 'endereco', + PRESIDENTE_MUNICIPIO: 'municipio_id', + PRESIDENTE_BAIRRO: 'bairro', + PRESIDENTE_CEP: 'cep', + PRESIDENTE_REDES_SOCIAIS: 'redes_sociais', + } + + def get(self, request): + form = AtualizaCasaForm() + return render(request, 'casas/importar.html', {'form': form}) + + def post(self, request): + form = AtualizaCasaForm(request.POST, request.FILES) + + if form.is_valid(): + file = form.cleaned_data['arquivo'] + reader = csv.DictReader(file) + if not self.ID_FIELDS.issubset(reader.fieldnames): + return render( + request, + 'casas/importar.html', + {'form': form, 'error': _(u"O arquivo não possui algum dos " + u"campos obrigatórios")} + ) + + if self.importa(reader): + # Importação concluída com êxito + return render( + request, + 'casas/importar_result.html', + {'file_name': file.name, 'total': self.total_registros, + 'com_erros': 0} + ) + else: + # Importado com erros + file_name = "casas-erros-{:%Y-%m-%d-%H%M}.csv".format( + datetime.now()) + fields = self.fieldnames + for f in reader.fieldnames: + if f not in fields: + fields.append(f) + with open(settings.MEDIA_ROOT+'/temp/'+file_name, "w+") as f: + writer = csv.DictWriter(f, fieldnames=fields) + writer.writeheader() + writer.writerows(self.errors) + return render( + request, + 'casas/importar_result.html', + {'file_name': file.name, 'result_file': file_name, + 'total': self.total_registros, + 'com_erros': len(self.errors)} + ) + + response = HttpResponse(content_type='text/csv') + response['Content-Disposition'] = ( + 'attachment; filename="somefilename.csv"') + return response + else: + return render( + request, + 'casas/importar.html', + {'form': form, 'error': u"Erro no preenchimento do formulário."} + ) + + def importa(self, reader): + self.errors = [] + self.total_registros = 0 + + for reg in reader: + self.total_registros += 1 + reg[self.ERROS] = [] + orgao = Orgao.objects.filter( + tipo__sigla=reg[self.TIPO], + municipio__nome=reg[self.MUNICIPIO], + municipio__uf__sigla=reg[self.UF] + ) + if orgao.count() == 0: + reg[self.ERROS].append("Nao existe orgao com esta identificacao") + self.errors.append(reg) + continue + elif orgao.count() > 1: + reg[self.ERROS].append("Existem {count} orgaos com esta mesma " + "identificacao").format(count=orgao.count()) + self.errors.append(reg) + continue + else: + orgao = orgao.get() + + # Atualiza os dados do órgão + for key in self.ORGAO_FIELDS: + field_name = self.ORGAO_FIELDS[key] + if key in reg: + value = reg[key].strip() + if key == self.ORGAO_TELEFONES: + for numero in value.split(" "): + try: + orgao.telefones.update_or_create(numero=numero) + except: + reg[self.ERROS].append( + 'Telefone {numero} não foi ' + 'atualizado'.format(numero=numero) + ) + elif value != "" and value != getattr(orgao, field_name): + setattr(orgao, field_name, value) + try: + orgao.save() + except Exception as e: + reg[self.ERROS].append( + "Erro salvando o orgao: '{message}'".format( + message=e.message) + ) + + # Atualiza o presidente + presidente = orgao.presidente + + if presidente is None: + presidente = Funcionario( + casa_legislativa=orgao, + setor="presidente" + ) + + for key in self.PRESIDENTE_FIELDS: + field_name = self.PRESIDENTE_FIELDS[key] + if key in reg: + value = reg[key].strip() + else: + value = "" + + if value != "": + if key == self.PRESIDENTE_MUNICIPIO: + if ',' in value: + municipio, uf = value.split(',') + else: + municipio = value + uf = reg[self.UF] + + try: + value = Municipio.objects.get( + nome__iexact=municipio.strip(), + uf__sigla=uf.strip()).pk + except: + value = None + reg[self.ERROS].append( + "Impossivel identificar o Municipio de " + "residencia do Presidente" + ) + continue + if key == self.PRESIDENTE_REDES_SOCIAIS: + value = value.replace(" ", "\r") + if key == self.PRESIDENTE_DATA_NASCIMENTO: + sd = value.split('/') + if len(sd) < 3: + reg[self.ERROS].append( + "Data de nascimento do presidente esta em um " + "formato nao reconhecido. Use DD/MM/AAAA" + ) + continue + else: + value = "{ano}-{mes}-{dia}".format( + ano=sd[2], + mes=sd[1], + dia=sd[0] + ) + if value != getattr(presidente, field_name): + setattr(presidente, field_name, value) + try: + presidente.save() + except Exception as e: + reg[self.ERROS].append( + "Erro salvando presidente: '{message}'".format( + message=e.message) + ) + + if len(reg[self.ERROS]) > 0: + self.errors.append(reg) + + return len(self.errors) == 0 # @param qs: queryset # @param o: (int) number of order field diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html index 179db60..6f61a15 100644 --- a/templates/admin/base_site.html +++ b/templates/admin/base_site.html @@ -40,6 +40,7 @@
  • {% trans 'Usuários' %} & {% trans 'Grupos' %}
  • {% trans 'Sites' %}
  • {% trans 'Diagnósticos' %}
  • +
  • {% trans 'Importar dados de Casas' %}
  • {% endif %} From 5d90feb6b02f136e0a95c75f96377c6fd308f7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 29 Apr 2021 11:25:31 -0300 Subject: [PATCH 39/69] Fix #55 --- sigi/apps/home/templatetags/menu_conf.yaml | 6 +++++ sigi/apps/servidores/admin.py | 22 ++++++++++++++----- .../migrations/0006_auto_20210429_0822.py | 21 ++++++++++++++++++ sigi/apps/servidores/models.py | 12 +++++++++- 4 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 sigi/apps/servidores/migrations/0006_auto_20210429_0822.py diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 7f0d05c..271306a 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -49,6 +49,12 @@ main_menu: url: eventos/calendario - title: Alocação de equipe url: eventos/alocacaoequipe/ + - title: Servidores + children: + - title: Serviços (unidades do ILB) + url: servidores/servico/ + - title: Servidores e colaboradores + url: servidores/servidor/ - title: Tabelas auxiliares children: - title: Tipos de órgãos diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index 5e64ced..dcd9ece 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -43,7 +43,8 @@ class ServicoAdmin(admin.ModelAdmin): @admin.register(Servidor) class ServidorAdmin(BaseModelAdmin): - list_display = ('foto', 'nome_completo', 'is_active', 'servico', ) + list_display = ('imagem_foto', 'nome_completo', 'is_active', 'servico', ) + list_display_links = ('imagem_foto', 'nome_completo',) list_filter = ('user__is_active', 'servico',) search_fields = ('nome_completo', 'user__email', 'user__first_name', 'user__last_name', 'user__username', 'servico__nome', @@ -55,8 +56,8 @@ class ServidorAdmin(BaseModelAdmin): return super(ServidorAdmin, self).lookup_allowed(lookup, value) or \ lookup in ['user__is_active__exact'] - def has_add_permission(self, request): - return False + # def has_add_permission(self, request): + # return False def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'foto': @@ -66,7 +67,18 @@ class ServidorAdmin(BaseModelAdmin): return super(ServidorAdmin, self).formfield_for_dbfield(db_field, **kwargs) def is_active(self, servidor): - return servidor.user.is_active + if servidor.user: + return servidor.user.is_active + else: + return False is_active.admin_order_field = 'user__is_active' is_active.boolean = True - is_active.short_description = _(u'ativo') \ No newline at end of file + is_active.short_description = _(u'ativo') + + def imagem_foto(sels, servidor): + if servidor.foto: + return u''.format(url=servidor.foto.url) + else: + return u"" + imagem_foto.short_description = _(u"foto") + imagem_foto.allow_tags = True \ No newline at end of file diff --git a/sigi/apps/servidores/migrations/0006_auto_20210429_0822.py b/sigi/apps/servidores/migrations/0006_auto_20210429_0822.py new file mode 100644 index 0000000..72737ed --- /dev/null +++ b/sigi/apps/servidores/migrations/0006_auto_20210429_0822.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0005_auto_20210423_0904'), + ] + + operations = [ + migrations.AlterField( + model_name='servidor', + name='user', + field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 48c7128..97f518d 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -32,7 +32,12 @@ class Servico(models.Model): return u"{sigla} - {nome}".format(sigla=self.sigla, nome=self.nome) class Servidor(models.Model): - user = models.ForeignKey(User, on_delete=models.CASCADE, unique=True) + user = models.ForeignKey( + User, + on_delete=models.CASCADE, + null=True, + blank=True + ) nome_completo = models.CharField(max_length=128) apelido = models.CharField(max_length=50, blank=True) foto = models.ImageField( @@ -57,6 +62,11 @@ class Servidor(models.Model): def __unicode__(self): return self.nome_completo + def save(self, *args, **kwargs): + if self.user is not None: + Servidor.objects.filter(user=self.user).update(user=None) + return super(Servidor, self).save(*args, **kwargs) + # Soluçao alternativa para extender o usuário do django # Acessa do servidor de um objeto user criando um profile # baseado nos dados do LDAP From 18a050df8886c7ec508389cd46745b5da088c853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 30 Apr 2021 09:45:31 -0300 Subject: [PATCH 40/69] Fixes #55 --- sigi/apps/servidores/admin.py | 11 +++++-- .../migrations/0007_auto_20210430_0735.py | 32 +++++++++++++++++++ sigi/apps/servidores/models.py | 6 ++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 sigi/apps/servidores/migrations/0007_auto_20210430_0735.py diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index dcd9ece..7e45acf 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -45,12 +45,19 @@ class ServicoAdmin(admin.ModelAdmin): class ServidorAdmin(BaseModelAdmin): list_display = ('imagem_foto', 'nome_completo', 'is_active', 'servico', ) list_display_links = ('imagem_foto', 'nome_completo',) - list_filter = ('user__is_active', 'servico',) + list_filter = ('user__is_active', 'externo', 'servico') search_fields = ('nome_completo', 'user__email', 'user__first_name', 'user__last_name', 'user__username', 'servico__nome', 'servico__sigla') raw_id_fields = ('user',) - fields = ['user', 'nome_completo', 'foto', 'servico',] + fieldsets = ( + (None, { + 'fields': ('user', 'nome_completo', 'foto', 'servico',) + }), + (_(u"outros órgãos"), { + 'fields': ('externo', 'orgao_origem', 'qualificacoes'), + }), + ) def lookup_allowed(self, lookup, value): return super(ServidorAdmin, self).lookup_allowed(lookup, value) or \ diff --git a/sigi/apps/servidores/migrations/0007_auto_20210430_0735.py b/sigi/apps/servidores/migrations/0007_auto_20210430_0735.py new file mode 100644 index 0000000..d6c5300 --- /dev/null +++ b/sigi/apps/servidores/migrations/0007_auto_20210430_0735.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0006_auto_20210429_0822'), + ] + + operations = [ + migrations.AddField( + model_name='servidor', + name='externo', + field=models.BooleanField(default=False, verbose_name='colaborador externo'), + preserve_default=True, + ), + migrations.AddField( + model_name='servidor', + name='orgao_origem', + field=models.CharField(max_length=100, verbose_name='\xf3rg\xe3o de origem, ', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='servidor', + name='qualificacoes', + field=models.TextField(verbose_name='qualifica\xe7\xf5es', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 97f518d..db80fee 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -54,6 +54,12 @@ class Servidor(models.Model): blank=True, null=True ) + externo = models.BooleanField(_(u"colaborador externo"), default=False) + orgao_origem = models.CharField( + _(u"órgão de origem, "), + max_length=100, blank=True + ) + qualificacoes = models.TextField(_(u"qualificações"), blank=True) class Meta: ordering = ('nome_completo',) From 1c7b148e7cb01b0a9a9bfea06d2f00458bb253e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 30 Apr 2021 11:06:24 -0300 Subject: [PATCH 41/69] Fixes #54 --- sigi/apps/casas/templates/casas/importar.html | 4 +- sigi/apps/casas/views.py | 167 +++++++++++------- 2 files changed, 110 insertions(+), 61 deletions(-) diff --git a/sigi/apps/casas/templates/casas/importar.html b/sigi/apps/casas/templates/casas/importar.html index 065f1d4..02c708d 100644 --- a/sigi/apps/casas/templates/casas/importar.html +++ b/sigi/apps/casas/templates/casas/importar.html @@ -1,5 +1,5 @@ {% extends "admin/base_site.html" %} -{% load i18n %} +{% load i18n bootstrap3 %} {% block content_title %}

    {% trans 'Importar dados para atualização de órgãos' %}

    @@ -15,7 +15,7 @@
    {% csrf_token %}
    - {{ form }} + {% bootstrap_form form %}
    diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 0a1642d..2699963 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -47,6 +47,15 @@ class importa_casas(View): PRESIDENTE_BAIRRO = 'presidente_bairro' PRESIDENTE_CEP = 'presidente_cep' PRESIDENTE_REDES_SOCIAIS = 'presidente_redes_sociais' + SERVIDOR_NOME = 'contato_nome' + SERVIDOR_DATA_NASCIMENTO = 'contato_data_nascimento' + SERVIDOR_TELEFONES = 'contato_telefones' + SERVIDOR_EMAILS = 'contato_emails' + SERVIDOR_ENDERECO = 'contato_endereco' + SERVIDOR_MUNICIPIO = 'contato_municipio' + SERVIDOR_BAIRRO = 'contato_bairro' + SERVIDOR_CEP = 'contato_cep' + SERVIDOR_REDES_SOCIAIS = 'contato_redes_sociais' ERROS = 'erros_importacao' fieldnames = [TIPO, MUNICIPIO, UF, ORGAO_ENDERECO, ORGAO_BAIRRO, ORGAO_CEP, @@ -54,7 +63,9 @@ class importa_casas(View): PRESIDENTE_DATA_NASCIMENTO, PRESIDENTE_TELEFONES, PRESIDENTE_EMAILS, PRESIDENTE_ENDERECO, PRESIDENTE_MUNICIPIO, PRESIDENTE_BAIRRO, PRESIDENTE_CEP, PRESIDENTE_REDES_SOCIAIS, - ERROS,] + SERVIDOR_NOME, SERVIDOR_DATA_NASCIMENTO, SERVIDOR_TELEFONES, + SERVIDOR_EMAILS, SERVIDOR_ENDERECO, SERVIDOR_MUNICIPIO, + SERVIDOR_BAIRRO, SERVIDOR_CEP, SERVIDOR_REDES_SOCIAIS, ERROS,] ID_FIELDS = {TIPO, MUNICIPIO, UF} @@ -79,6 +90,18 @@ class importa_casas(View): PRESIDENTE_REDES_SOCIAIS: 'redes_sociais', } + SERVIDOR_FIELDS = { + SERVIDOR_NOME: 'nome', + SERVIDOR_DATA_NASCIMENTO: 'data_nascimento', + SERVIDOR_TELEFONES: 'nota', + SERVIDOR_EMAILS: 'email', + SERVIDOR_ENDERECO: 'endereco', + SERVIDOR_MUNICIPIO: 'municipio_id', + SERVIDOR_BAIRRO: 'bairro', + SERVIDOR_CEP: 'cep', + SERVIDOR_REDES_SOCIAIS: 'redes_sociais', + } + def get(self, request): form = AtualizaCasaForm() return render(request, 'casas/importar.html', {'form': form}) @@ -136,6 +159,85 @@ class importa_casas(View): {'form': form, 'error': u"Erro no preenchimento do formulário."} ) + # Atualiza ou cria funcionário + def funcionario_update(self, setor, fields, orgao, reg): + field_nome = (self.PRESIDENTE_NOME if setor == 'presidente' else + self.SERVIDOR_NOME) + funcionario = orgao.funcionario_set.filter( + setor=setor, + nome__iexact=reg[field_nome].strip() + ) + + if funcionario.count() == 0: + funcionario = Funcionario( + casa_legislativa=orgao, + nome=reg[field_nome].strip(), + setor=setor + ) + else: + funcionario = funcionario.first() #HACK: Sempre atualiza o primeiro + + for key in fields: + field_name = fields[key] + if key in reg: + value = reg[key].strip() + else: + value = "" + + if value != "": + if field_name == 'municipio_id': + if ',' in value: + municipio, uf = value.split(',') + else: + municipio = value + uf = reg[self.UF] + + try: + value = Municipio.objects.get( + nome__iexact=municipio.strip(), + uf__sigla=uf.strip()).pk + except: + value = None + reg[self.ERROS].append( + "Impossivel identificar o Municipio de " + "residencia do {contato}".format( + contato="Presidente" if setor == 'presidente' + else "Contato") + ) + continue + if field_name == 'redes_sociais': + value = value.replace(" ", "\r") + if field_name == 'data_nascimento': + sd = value.split('/') + if len(sd) < 3: + reg[self.ERROS].append( + "Data de nascimento do {contato} esta em um " + "formato nao reconhecido. Use DD/MM/AAAA".format( + contato="Presidente" if setor == 'presidente' + else "Contato" + ) + ) + continue + else: + value = "{ano}-{mes}-{dia}".format( + ano=sd[2], + mes=sd[1], + dia=sd[0] + ) + if value != getattr(funcionario, field_name): + setattr(funcionario, field_name, value) + try: + funcionario.save() + except Exception as e: + reg[self.ERROS].append( + "Erro salvando {contato}: '{message}'".format( + message=e.message, + contato="Presidente" if setor == 'presidente' + else "Contato") + ) + + return reg + def importa(self, reader): self.errors = [] self.total_registros = 0 @@ -185,65 +287,12 @@ class importa_casas(View): ) # Atualiza o presidente - presidente = orgao.presidente - - if presidente is None: - presidente = Funcionario( - casa_legislativa=orgao, - setor="presidente" - ) + reg = self.funcionario_update("presidente", self.PRESIDENTE_FIELDS, + orgao, reg) - for key in self.PRESIDENTE_FIELDS: - field_name = self.PRESIDENTE_FIELDS[key] - if key in reg: - value = reg[key].strip() - else: - value = "" - - if value != "": - if key == self.PRESIDENTE_MUNICIPIO: - if ',' in value: - municipio, uf = value.split(',') - else: - municipio = value - uf = reg[self.UF] - - try: - value = Municipio.objects.get( - nome__iexact=municipio.strip(), - uf__sigla=uf.strip()).pk - except: - value = None - reg[self.ERROS].append( - "Impossivel identificar o Municipio de " - "residencia do Presidente" - ) - continue - if key == self.PRESIDENTE_REDES_SOCIAIS: - value = value.replace(" ", "\r") - if key == self.PRESIDENTE_DATA_NASCIMENTO: - sd = value.split('/') - if len(sd) < 3: - reg[self.ERROS].append( - "Data de nascimento do presidente esta em um " - "formato nao reconhecido. Use DD/MM/AAAA" - ) - continue - else: - value = "{ano}-{mes}-{dia}".format( - ano=sd[2], - mes=sd[1], - dia=sd[0] - ) - if value != getattr(presidente, field_name): - setattr(presidente, field_name, value) - try: - presidente.save() - except Exception as e: - reg[self.ERROS].append( - "Erro salvando presidente: '{message}'".format( - message=e.message) - ) + # Atualiza o contato + reg = self.funcionario_update("outros", self.SERVIDOR_FIELDS, + orgao, reg) if len(reg[self.ERROS]) > 0: self.errors.append(reg) From 7da41a0ce9be5a21f9502766cfd2fb0233ccc217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 30 Apr 2021 11:13:28 -0300 Subject: [PATCH 42/69] Fix #55 - completando o template --- sigi/apps/casas/templates/casas/importar.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sigi/apps/casas/templates/casas/importar.html b/sigi/apps/casas/templates/casas/importar.html index 02c708d..ff72642 100644 --- a/sigi/apps/casas/templates/casas/importar.html +++ b/sigi/apps/casas/templates/casas/importar.html @@ -64,6 +64,15 @@ presidente_bairroO nome do bairro onde mora o presidente presidente_cepO novo CEP do presidente presidente_redes_sociaisAs redes sociais do presidente. Pode conter quantas redes sociais forem necessárias. Utilize espaço para separar uma rede da outra. + contato_nomeO nome completo do contato + contato_data_nascimentoA data de nascimento do contato no formato DD/MM/AAAA + contato_telefonesOs telefones ou whatsapp do contato. Pode conter quantos telefones forem necessários, separando-os por espaço. Use a formatação padrão de telefones, mas não use espaço entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. + contato_emailsOs e-mails do contato. Pode conter quantos e-mails forem necessários. Utilize espaço para separar um e-mail do outro + contato_enderecoO novo endereço do contato + contato_municipioO nome do município onde mora o contato + contato_bairroO nome do bairro onde mora o contato + contato_cepO novo CEP do contato + contato_redes_sociaisAs redes sociais do contato. Pode conter quantas redes sociais forem necessárias. Utilize espaço para separar uma rede da outra. From 6b6dc5c18e74fd9da75313014c24a8f8541676e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 30 Apr 2021 16:00:33 -0300 Subject: [PATCH 43/69] =?UTF-8?q?Ajustes=20na=20importa=C3=A7=C3=A3o=20de?= =?UTF-8?q?=20Casas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/templates/casas/importar.html | 10 +++++----- sigi/apps/casas/views.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sigi/apps/casas/templates/casas/importar.html b/sigi/apps/casas/templates/casas/importar.html index ff72642..ddff89c 100644 --- a/sigi/apps/casas/templates/casas/importar.html +++ b/sigi/apps/casas/templates/casas/importar.html @@ -54,11 +54,11 @@ orgao_cepO novo CEP do órgão orgao_emailO novo e-mail institucional do órgão orgao_portalO novo endereço do portal institucional do órgão - orgao_telefonesOs telefones do órgão. Pode conter quantos telefones forem necessários, separando-os por espaço. Use a formatação padrão de telefones, mas não use espaço entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. + orgao_telefonesOs telefones do órgão. Pode conter quantos telefones forem necessários, separando-os por ';'. Use a formatação padrão de telefones, mas não use ';' entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. presidente_nomeO nome completo do presidente presidente_data_nascimentoA data de nascimento do presidente no formato DD/MM/AAAA - presidente_telefonesOs telefones ou whatsapp do presidente. Pode conter quantos telefones forem necessários, separando-os por espaço. Use a formatação padrão de telefones, mas não use espaço entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. - presidente_emailsOs e-mails do presidente. Pode conter quantos e-mails forem necessários. Utilize espaço para separar um e-mail do outro + presidente_telefonesOs telefones ou whatsapp do presidente. Pode conter quantos telefones forem necessários, separando-os por ';'. Use a formatação padrão de telefones, mas não use ';' entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. + presidente_emailsOs e-mails do presidente. Pode conter quantos e-mails forem necessários. Utilize ';' para separar um e-mail do outro presidente_enderecoO novo endereço do presidente presidente_municipioO nome do município onde mora o presidente presidente_bairroO nome do bairro onde mora o presidente @@ -66,8 +66,8 @@ presidente_redes_sociaisAs redes sociais do presidente. Pode conter quantas redes sociais forem necessárias. Utilize espaço para separar uma rede da outra. contato_nomeO nome completo do contato contato_data_nascimentoA data de nascimento do contato no formato DD/MM/AAAA - contato_telefonesOs telefones ou whatsapp do contato. Pode conter quantos telefones forem necessários, separando-os por espaço. Use a formatação padrão de telefones, mas não use espaço entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. - contato_emailsOs e-mails do contato. Pode conter quantos e-mails forem necessários. Utilize espaço para separar um e-mail do outro + contato_telefonesOs telefones ou whatsapp do contato. Pode conter quantos telefones forem necessários, separando-os por ';'. Use a formatação padrão de telefones, mas não use ';' entre os dígitos de um telefone, senão o sistema interpretará como dois telefones diferentes. + contato_emailsOs e-mails do contato. Pode conter quantos e-mails forem necessários. Utilize ';' para separar um e-mail do outro contato_enderecoO novo endereço do contato contato_municipioO nome do município onde mora o contato contato_bairroO nome do bairro onde mora o contato diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 2699963..65bc06c 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -268,7 +268,8 @@ class importa_casas(View): if key in reg: value = reg[key].strip() if key == self.ORGAO_TELEFONES: - for numero in value.split(" "): + for numero in value.split(";"): + numero = numero.strip() try: orgao.telefones.update_or_create(numero=numero) except: From c2f1d3a76f1ec835da7f8a2ce6807975f5d4a26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Sat, 1 May 2021 10:57:03 -0300 Subject: [PATCH 44/69] Fix #56 --- sigi/apps/casas/admin.py | 63 +++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index de91b80..1204ba0 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -208,12 +208,23 @@ class ConveniosInline(admin.TabularInline): class ServicoInline(admin.TabularInline): model = Servico - fields = ['url', 'contato_tecnico', 'contato_administrativo', 'hospedagem_interlegis', 'data_ativacao', 'data_alteracao', 'data_desativacao'] - readonly_fields = ['url', 'contato_tecnico', 'contato_administrativo', 'hospedagem_interlegis', 'data_ativacao', 'data_alteracao', 'data_desativacao'] + fields = ('link_url', 'contato_tecnico', 'contato_administrativo', + 'hospedagem_interlegis', 'data_ativacao', 'data_alteracao', + 'data_desativacao') + readonly_fields = ['link_url', 'contato_tecnico', 'contato_administrativo', + 'hospedagem_interlegis', 'data_ativacao', + 'data_alteracao', 'data_desativacao'] extra = 0 max_num = 0 can_delete = False + def link_url(self, servico): + if servico.data_desativacao is not None: + return servico.url + return u'{url}'.format(url=servico.url) + link_url.short_description = _(u'URL do serviço') + link_url.allow_tags = True + # class PlanoDiretorInline(admin.TabularInline): # model = PlanoDiretor @@ -302,7 +313,7 @@ class ServicoFilter(admin.SimpleListFilter): return queryset.distinct('municipio__uf__nome', 'nome') - +@admin.register(Orgao) class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): form = OrgaoForm actions = ['adicionar_casas', ] @@ -339,11 +350,9 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): search_fields = ('search_text', 'sigla', 'cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') - # filter_horizontal = ('gerentes_interlegis',) def get_uf(self, obj): return obj.municipio.uf.nome - get_uf.short_description = _(u'Unidade da Federação') get_uf.admin_order_field = 'municipio__uf__nome' @@ -353,16 +362,16 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): get_gerentes.allow_tags = True def get_convenios(self, obj): - return '
      ' + ''.join(['
    • %s
    • ' % c.__unicode__() for c in obj.convenio_set.all()]) + '
    ' - + return '
      ' + ''.join(['
    • %s
    • ' % c.__unicode__() + for c in obj.convenio_set.all()]) + '
    ' get_convenios.short_description = _(u'Convênios') get_convenios.allow_tags = True def get_servicos(self, obj): - return '
      ' + ''.join(['
    • %s
    • ' % s.__unicode__() - for s in obj.servico_set.filter( - data_desativacao__isnull=True)]) + '
    ' - + return u'
      ' + u''.join( + [u'
    • {servico}
    • '.format( + url=s.url, servico=s.__unicode__()) for s in + obj.servico_set.filter(data_desativacao__isnull=True)]) + u'
    ' get_servicos.short_description = _(u'Serviços') get_servicos.allow_tags = True @@ -381,28 +390,29 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): def etiqueta(self, request, queryset): return labels_report(request, queryset=queryset) - - etiqueta.short_description = _(u"Gerar etiqueta(s) da(s) casa(s) selecionada(s)") + etiqueta.short_description = _(u"Gerar etiqueta(s) da(s) casa(s) " + u"selecionada(s)") def etiqueta_sem_presidente(self, request, queryset): return labels_report_sem_presidente(request, queryset=queryset) - - etiqueta_sem_presidente.short_description = _(u"Gerar etiqueta(s) sem presidente da(s) casa(s) selecionada(s)") + etiqueta_sem_presidente.short_description = _(u"Gerar etiqueta(s) sem " + u"presidente da(s) casa(s) " + u"selecionada(s)") def relatorio(self, request, queryset): return report(request, queryset=queryset) - - relatorio.short_description = _(u"Exportar a(s) casa(s) selecionada(s) para PDF") + relatorio.short_description = _(u"Exportar a(s) casa(s) selecionada(s) " + u"para PDF") def relatorio_completo(self, request, queryset): return report_complete(request, queryset=queryset) - - relatorio_completo.short_description = _(u"Gerar relatório completo da(s) casa(s) selecionada(s)") + relatorio_completo.short_description = _(u"Gerar relatório completo da(s) " + u"casa(s) selecionada(s)") def relatorio_csv(self, request, queryset): return export_csv(request) - - relatorio_csv.short_description = _(u"Exportar casa(s) selecionada(s) para CSV") + relatorio_csv.short_description = _(u"Exportar casa(s) selecionada(s) " + u"para CSV") def adicionar_casas(self, request, queryset): if 'carrinho_casas' in request.session: @@ -414,12 +424,15 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): q2 = len(request.session['carrinho_casas']) quant = q2 - q1 if quant: - self.message_user(request, str(q2 - q1) + " " + _(u"Casas Legislativas adicionadas no carrinho")) + self.message_user(request, str(q2 - q1) + " " + + _(u"Casas Legislativas adicionadas no carrinho")) else: - self.message_user(request, _(u"As Casas Legislativas selecionadas já foram adicionadas anteriormente")) + self.message_user(request, _(u"As Casas Legislativas selecionadas " + u"já foram adicionadas anteriormente")) return HttpResponseRedirect('.') - adicionar_casas.short_description = _(u"Armazenar casas no carrinho para exportar") + adicionar_casas.short_description = _(u"Armazenar casas no carrinho para " + u"exportar") def get_actions(self, request): actions = super(OrgaoAdmin, self).get_actions(request) @@ -427,6 +440,4 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): del actions['delete_selected'] return actions - -admin.site.register(Orgao, OrgaoAdmin) admin.site.register(TipoOrgao) From f53ac441731c7e4b1f2258eb4373ae845f7d6ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Sat, 1 May 2021 13:00:07 -0300 Subject: [PATCH 45/69] Aumentar campos no model casas.Funcionario --- .../migrations/0019_auto_20210501_1058.py | 26 +++++++++++++++++++ sigi/apps/casas/models.py | 4 +-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 sigi/apps/casas/migrations/0019_auto_20210501_1058.py diff --git a/sigi/apps/casas/migrations/0019_auto_20210501_1058.py b/sigi/apps/casas/migrations/0019_auto_20210501_1058.py new file mode 100644 index 0000000..0dc0e4b --- /dev/null +++ b/sigi/apps/casas/migrations/0019_auto_20210501_1058.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('casas', '0018_orgao_sigla'), + ] + + operations = [ + migrations.AlterField( + model_name='funcionario', + name='email', + field=models.CharField(max_length=250, verbose_name='e-mail', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='funcionario', + name='nota', + field=models.CharField(max_length=250, null=True, verbose_name='Telefones', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 4a63403..4aaf760 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -379,11 +379,11 @@ class Funcionario(models.Model): ) nota = models.CharField( _(u"Telefones"), - max_length=70, + max_length=250, null=True, blank=True ) - email = models.CharField(_(u'e-mail'), max_length=75, blank=True) + email = models.CharField(_(u'e-mail'), max_length=250, blank=True) # endereco = generic.GenericRelation('contatos.Endereco') endereco = models.CharField(_(u'Endereço'), max_length=100, blank=True) municipio = models.ForeignKey( From 64c19e79ff4fee0d826b3338e7b25ffaa6fb0b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 3 May 2021 11:46:14 -0300 Subject: [PATCH 46/69] =?UTF-8?q?Bug=20na=20rotina=20de=20importa=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20Casas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 65bc06c..eff23be 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -163,6 +163,12 @@ class importa_casas(View): def funcionario_update(self, setor, fields, orgao, reg): field_nome = (self.PRESIDENTE_NOME if setor == 'presidente' else self.SERVIDOR_NOME) + + # Se não tem nome do contato (ou presidente), então não há nada a + # atualizar. Volta o reg inalterado. + if field_nome not in reg: + return reg + funcionario = orgao.funcionario_set.filter( setor=setor, nome__iexact=reg[field_nome].strip() From 2052f3a292be52ae76c76379bdac020286401ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 3 May 2021 12:05:58 -0300 Subject: [PATCH 47/69] Apenas superusers podem importar Casas --- sigi/apps/casas/urls.py | 37 +++++++++++++++++++++++++------------ sigi/apps/casas/views.py | 6 ++++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/sigi/apps/casas/urls.py b/sigi/apps/casas/urls.py index f94a467..9d73253 100644 --- a/sigi/apps/casas/urls.py +++ b/sigi/apps/casas/urls.py @@ -1,5 +1,6 @@ # coding: utf-8 from django.conf.urls import patterns, url +from django.contrib.auth.decorators import login_required from sigi.apps.casas.views import importa_casas @@ -7,36 +8,48 @@ urlpatterns = patterns( 'sigi.apps.casas.views', # Informacoes de uma casa legislativa - url(r'^orgao/report_complete/$', 'report_complete', name='report-complete-all'), - url(r'^orgao/(?P\w+)/report_complete/$', 'report_complete', name='report-complete-id'), + url(r'^orgao/report_complete/$', 'report_complete', + name='report-complete-all'), + url(r'^orgao/(?P\w+)/report_complete/$', 'report_complete', + name='report-complete-id'), # Reports Labels url(r'^orgao/labels/$', 'labels_report', name='labels-report-all'), - url(r'^orgao/(?P\w+)/labels/$', 'labels_report', name='labels-report-id'), + url(r'^orgao/(?P\w+)/labels/$', 'labels_report', + name='labels-report-id'), # Reports Labels Parlamentar - url(r'^orgao/labels_parlamentar/$', 'labels_report_parlamentar', name='lebels-report-parlamentar-all'), - url(r'^orgao/(?P\w+)/labels_parlamentar/$', 'labels_report_parlamentar', name='labels-report-parlamentar-id'), + url(r'^orgao/labels_parlamentar/$', 'labels_report_parlamentar', + name='lebels-report-parlamentar-all'), + url(r'^orgao/(?P\w+)/labels_parlamentar/$', 'labels_report_parlamentar', + name='labels-report-parlamentar-id'), # Reports labels sem presidente - url(r'^orgao/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-all'), - url(r'^orgao/(?P\w+)/labels_sem_presidente/$', 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), + url(r'^orgao/labels_sem_presidente/$', 'labels_report_sem_presidente', + name='labels-report-sem-presidente-all'), + url(r'^orgao/(?P\w+)/labels_sem_presidente/$', + 'labels_report_sem_presidente', name='labels-report-sem-presidente-id'), # Reports casas sem convenio url(r'^orgao/reports/$', 'report', name='casa-report'), - url(r'^orgao/casas_sem_convenio_report/$', 'casas_sem_convenio_report', name='casas-sem-convenio-report'), + url(r'^orgao/casas_sem_convenio_report/$', 'casas_sem_convenio_report', + name='casas-sem-convenio-report'), # CSV url(r'^orgao/csv/$', 'export_csv', name='casa-export-csv'), # Error # Carrinho - url(r'^orgao/carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'), - url(r'^orgao/carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'), # Error - url(r'^orgao/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'), # Error + url(r'^orgao/carrinho/$', 'visualizar_carrinho', + name='visualizar-carrinho'), + url(r'^orgao/carrinho/excluir_carrinho/$', 'excluir_carrinho', + name='excluir-carrinho'), # Error + url(r'^orgao/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', + name='deleta-itens-carrinho'), # Error url(r'^portfolio/$', 'portfolio', name='casas-portfolio'), url(r'^carteira/$', 'painel_relacionamento', name='casas-carteira'), # Atualização por CSV - url(r'^orgao/importa/$', importa_casas.as_view(), name='importar-casas'), + url(r'^orgao/importa/$', login_required(importa_casas.as_view()), + name='importar-casas'), ) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index eff23be..ffb289f 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -103,10 +103,16 @@ class importa_casas(View): } def get(self, request): + if not request.user.is_superuser: + return HttpResponseForbidden() + form = AtualizaCasaForm() return render(request, 'casas/importar.html', {'form': form}) def post(self, request): + if not request.user.is_superuser: + return HttpResponseForbidden() + form = AtualizaCasaForm(request.POST, request.FILES) if form.is_valid(): From c23371695c930a7983b547e022f39e05bcdc0f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Sun, 9 May 2021 13:50:16 -0300 Subject: [PATCH 48/69] Exportar dados de oficinas para CSV --- sigi/apps/eventos/admin.py | 25 +- .../templates/admin/eventos/change_list.html | 1 + .../eventos/templates/eventos/carrinho.html | 63 +++++ sigi/apps/eventos/urls.py | 9 + sigi/apps/eventos/views.py | 246 +++++++++++++++--- 5 files changed, 307 insertions(+), 37 deletions(-) create mode 100644 sigi/apps/eventos/templates/admin/eventos/change_list.html create mode 100644 sigi/apps/eventos/templates/eventos/carrinho.html diff --git a/sigi/apps/eventos/admin.py b/sigi/apps/eventos/admin.py index 088d82c..e82717e 100644 --- a/sigi/apps/eventos/admin.py +++ b/sigi/apps/eventos/admin.py @@ -18,10 +18,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -from django.contrib import admin from django import forms +from django.contrib import admin +from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from sigi.apps.eventos.models import TipoEvento, Funcao, Evento, Equipe, Convite +from sigi.apps.eventos.views import adicionar_eventos_carrinho class EventoAdminForm(forms.ModelForm): class Meta: @@ -69,4 +71,23 @@ class EventoAdmin(admin.ModelAdmin): raw_id_fields = ('casa_anfitria', 'municipio',) search_fields = ('nome', 'tipo_evento__nome', 'casa_anfitria__search_text', 'municipio__search_text', 'solicitante') - inlines = (EquipeInline, ConviteInline) \ No newline at end of file + inlines = (EquipeInline, ConviteInline) + actions = ['adicionar_eventos', ] + + def adicionar_eventos(self, request, queryset): + if 'carrinho_eventos' in request.session: + q1 = len(request.session['carrinho_eventos']) + else: + q1 = 0 + response = adicionar_eventos_carrinho(request, queryset=queryset) + q2 = len(request.session['carrinho_eventos']) + quant = q2 - q1 + if quant: + self.message_user(request, str(q2 - q1) + " " + + _(u"Eventos adicionados no carrinho")) + else: + self.message_user(request, _(u"Os Eventos selecionados " + u"já foram adicionados anteriormente")) + return HttpResponseRedirect('.') + adicionar_eventos.short_description = _(u"Armazenar eventos no carrinho " + u"para exportar") diff --git a/sigi/apps/eventos/templates/admin/eventos/change_list.html b/sigi/apps/eventos/templates/admin/eventos/change_list.html new file mode 100644 index 0000000..83ebd55 --- /dev/null +++ b/sigi/apps/eventos/templates/admin/eventos/change_list.html @@ -0,0 +1 @@ +{% extends "change_list_with_cart.html" %} \ No newline at end of file diff --git a/sigi/apps/eventos/templates/eventos/carrinho.html b/sigi/apps/eventos/templates/eventos/carrinho.html new file mode 100644 index 0000000..554f8b4 --- /dev/null +++ b/sigi/apps/eventos/templates/eventos/carrinho.html @@ -0,0 +1,63 @@ +{% extends "admin/carrinho.html" %} +{% load admin_list i18n %} +{% block extrastyle %} + {{ block.super }} + {#% include "admin/tabs_style.html" %#} +{% endblock %} + +{% block title %}{% trans 'Eventos no Carrinho | SIGI' %}{% endblock %} +{% block content_title %}

    {% trans 'Eventos no Carrinho' %}

    {% endblock %} + +{% block mensagem%} +
      + {%if carIsEmpty%} +
    • {% trans 'O carrinho está vazio, sendo assim todos os eventos entram na lista para exportação de acordo com os filtros aplicados.' %}
    • + {%else%} +
    • {{paginas.paginator.count}} {% trans 'Eventos no carrinho' %}.
    • + {%endif%} +
    +{% endblock %} + +{% block action %}deleta_itens_carrinho{% endblock %} + +{% block tabela %} + + + + {%if not carIsEmpty%} + + {% endif %} + + + + + + + + + + + {% for evento in paginas.object_list %} + + {%if not carIsEmpty%} + + {% endif %} + + + + + + + + + {% endfor %} + +
    + {% trans 'Nome do evento' %}{% trans 'Tipo evento' %}{% trans 'Status' %}{% trans 'Data de início' %}{% trans 'Data de término' %}{% trans 'município' %}{% trans 'Solicitante' %}
    + {{evento.nome}}{{evento.tipo_evento}}{{evento.get_status_display}}{{evento.data_inicio}}{{evento.data_termino}}{{evento.municipio}}{{evento.solicitante}}
    +{% endblock %} + +{% block botoes %} +{% trans "Exportar CVS" %} +{% endblock %} \ No newline at end of file diff --git a/sigi/apps/eventos/urls.py b/sigi/apps/eventos/urls.py index a648c7c..05af590 100644 --- a/sigi/apps/eventos/urls.py +++ b/sigi/apps/eventos/urls.py @@ -7,4 +7,13 @@ urlpatterns = patterns( # Painel de ocorrencias url(r'^calendario/$', 'calendario', name='eventos-calendario'), url(r'^alocacaoequipe/$', 'alocacao_equipe', name='eventos-alocacaoequipe'), + # Carrinho + url(r'^evento/carrinho/$', 'visualizar_carrinho', + name='visualizar-carrinho-evento'), + url(r'^evento/carrinho/excluir_carrinho/$', 'excluir_carrinho', + name='excluir-carrinho-evento'), # Error + url(r'^evento/carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', + name='deleta-itens-carrinho-evento'), # Error + url(r'^evento/csv/$', 'export_csv', name='evento-export-csv'), # Error + ) diff --git a/sigi/apps/eventos/views.py b/sigi/apps/eventos/views.py index e6ab84b..164f644 100644 --- a/sigi/apps/eventos/views.py +++ b/sigi/apps/eventos/views.py @@ -3,17 +3,17 @@ # sigi.apps.eventos.views # # Copyright (C) 2015 Interlegis -# +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -21,11 +21,14 @@ import calendar import datetime import locale +from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden +from django.core.paginator import Paginator, InvalidPage, EmptyPage +from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.utils import translation from django.utils.translation import ungettext, ugettext as _ -from sigi.apps.eventos.models import Evento +from sigi.apps.eventos.models import Evento, Equipe, Convite from sigi.apps.servidores.models import Servidor from sigi.shortcuts import render_to_pdf import csv @@ -36,28 +39,28 @@ def calendario(request): mes_pesquisa = int(request.GET.get('mes', datetime.date.today().month)) ano_pesquisa = int(request.GET.get('ano', datetime.date.today().year)) formato = request.GET.get('fmt', 'html') - + dia1 = datetime.date(ano_pesquisa, mes_pesquisa, 1) mes_anterior = dia1 - datetime.timedelta(days=1) mes_seguinte = dia1.replace(day=28) + datetime.timedelta(days=4) # Ugly hack mes_seguinte = mes_seguinte.replace(day=1) - + data = {'mes_pesquisa': mes_pesquisa, 'ano_pesquisa': ano_pesquisa} - if Evento.objects.filter(data_inicio__year=mes_anterior.year, + if Evento.objects.filter(data_inicio__year=mes_anterior.year, data_inicio__month=mes_anterior.month).exists(): data['prev_button'] = {'mes': mes_anterior.month, 'ano': mes_anterior.year } - - if Evento.objects.filter(data_inicio__year=mes_seguinte.year, + + if Evento.objects.filter(data_inicio__year=mes_seguinte.year, data_inicio__month=mes_seguinte.month).exists(): data['next_button'] = {'mes': mes_seguinte.month, 'ano': mes_seguinte.year } - + c = calendar.Calendar(6) dates = reduce(lambda x,y: x+y, c.monthdatescalendar(ano_pesquisa, mes_pesquisa)) - + eventos = [] - - for evento in Evento.objects.filter(data_inicio__year=ano_pesquisa, + + for evento in Evento.objects.filter(data_inicio__year=ano_pesquisa, data_inicio__month=mes_pesquisa).order_by('data_inicio'): start = dates.index(evento.data_inicio) if not evento.data_termino in dates: @@ -75,13 +78,13 @@ def calendario(request): # Agrupa os eventos em linhas para melhorar a visualização linhas = [] - + for evento in eventos: encaixado = False for linha in linhas: sobrepoe = False for e in linha: - if (((evento['evento'].data_inicio >= e['evento'].data_inicio) and + if (((evento['evento'].data_inicio >= e['evento'].data_inicio) and (evento['evento'].data_inicio <= e['evento'].data_termino)) or ((evento['evento'].data_termino >= e['evento'].data_inicio) and (evento['evento'].data_termino <= e['evento'].data_termino))): @@ -96,7 +99,7 @@ def calendario(request): # Adiciona uma nova linha porque este evento não se encaixa em nenhuma existente linhas.append([evento]) - # Recalcula as distâncias dos eventos por linha para encaixar no calendário + # Recalcula as distâncias dos eventos por linha para encaixar no calendário for linha in linhas: anterior = None for evento in linha: @@ -110,27 +113,27 @@ def calendario(request): data['dates'] = dates data['eventos'] = eventos data['linhas'] = linhas - + if formato == 'pdf': return render_to_pdf('eventos/calendario_pdf.html', data ) - + return render(request, 'eventos/calendario.html', data) @login_required def alocacao_equipe(request): ano_pesquisa = int(request.GET.get('ano', datetime.date.today().year)) formato = request.GET.get('fmt', 'html') - + data = {'ano_pesquisa': ano_pesquisa} - + if Evento.objects.filter(data_inicio__year=ano_pesquisa-1).exists(): data['prev_button'] = {'ano': ano_pesquisa - 1 } - + if Evento.objects.filter(data_inicio__year=ano_pesquisa+1).exists(): data['next_button'] = {'ano': ano_pesquisa + 1 } - + dados = [] - + for evento in Evento.objects.filter(data_inicio__year=ano_pesquisa).exclude(status='C').prefetch_related('equipe_set'): for p in evento.equipe_set.all(): registro = None @@ -141,36 +144,36 @@ def alocacao_equipe(request): if not registro: registro = [p.membro.pk, p.membro.nome_completo, [{'dias': 0, 'eventos': 0} for x in range(1,13)]] dados.append(registro) - + registro[2][evento.data_inicio.month-1]['dias'] += (evento.data_termino - evento.data_inicio).days + 1 registro[2][evento.data_inicio.month-1]['eventos'] += 1 - + dados.sort(lambda x, y: cmp(x[1], y[1])) - + lang = (translation.to_locale(translation.get_language())+'.utf8').encode() locale.setlocale(locale.LC_ALL, lang) meses = [calendar.month_name[m] for m in range(1,13)] - + linhas = [[_(u"Servidor")] + meses + ['total']] - + for r in dados: r[2].append(reduce(lambda x,y:{'dias': x['dias'] + y['dias'], 'eventos': x['eventos'] + y['eventos']}, r[2])) - linhas.append([r[1]] + + linhas.append([r[1]] + [_(ungettext(u"%(dias)s dia", u"%(dias)s dias", d['dias']) + " em " + ungettext(u"%(eventos)s evento", u"%(eventos)s eventos", d['eventos']) ) % d if d['dias'] > 0 or d['eventos'] > 0 else '' for d in r[2]]) - + # for registro in Servidor.objects.filter(equipe_evento__evento__data_inicio__year=ano_pesquisa).exclude(equipe_evento__evento__status='C').distinct(): # dados = [{'dias': 0, 'eventos': 0} for x in range(1,13)] # for part in registro.equipe_evento.filter(evento__data_inicio__year=ano_pesquisa).exclude(evento__status='C'): -# dados[part.evento.data_inicio.month-1]['dias'] += (part.evento.data_termino - +# dados[part.evento.data_inicio.month-1]['dias'] += (part.evento.data_termino - # part.evento.data_inicio).days + 1 # dados[part.evento.data_inicio.month-1]['eventos'] += 1 # dados.append([registro.nome_completo] + [_(ungettext(u"%(dias)s dia", u"%(dias)s dias", d['dias']) + " em " + ungettext(u"%(eventos)s evento", u"%(eventos)s eventos", d['eventos'])) % d if d['dias'] > 0 or d['eventos'] > 0 else '' for d in dados]) - + data['linhas'] = linhas - + if formato == 'pdf': return render_to_pdf('eventos/alocacao_equipe_pdf.html', data) elif formato == 'csv': @@ -187,5 +190,178 @@ def alocacao_equipe(request): 'meses': {m[0]: m[1] for m in zip(meses+['total'], d[2])} } for d in dados]} return JsonResponse(result) - - return render(request, 'eventos/alocacao_equipe.html', data) \ No newline at end of file + + return render(request, 'eventos/alocacao_equipe.html', data) + +# Views e functions para carrinho de exportação + +def query_ordena(qs, o): + from sigi.apps.eventos.admin import EventoAdmin + list_display = EventoAdmin.list_display + order_fields = [] + + for order_number in o.split('.'): + order_number = int(order_number) + order = '' + if order_number != abs(order_number): + order_number = abs(order_number) + order = '-' + order_fields.append(order + list_display[order_number - 1]) + qs = qs.order_by(*order_fields) + return qs + +def get_for_qs(get, qs): + kwargs = {} + for k, v in get.iteritems(): + if str(k) not in ('page', 'pop', 'q', '_popup', 'o', 'ot'): + kwargs[str(k)] = v + qs = qs.filter(**kwargs) + if 'o' in get: + qs = query_ordena(qs, get['o']) + return qs + +def carrinhoOrGet_for_qs(request): + if 'carrinho_eventos' in request.session: + ids = request.session['carrinho_eventos'] + qs = Evento.objects.filter(pk__in=ids) + else: + qs = Evento.objects.all() + if request.GET: + qs = get_for_qs(request.GET, qs) + return qs + +def adicionar_eventos_carrinho(request, queryset=None, id=None): + if request.method == 'POST': + ids_selecionados = request.POST.getlist('_selected_action') + if 'carrinho_eventos' not in request.session: + request.session['carrinho_eventos'] = ids_selecionados + else: + lista = request.session['carrinho_eventos'] + # Verifica se id já não está adicionado + for id in ids_selecionados: + if id not in lista: + lista.append(id) + request.session['carrinho_eventos'] = lista + +@login_required +def visualizar_carrinho(request): + qs = carrinhoOrGet_for_qs(request) + paginator = Paginator(qs, 100) + + try: + page = int(request.GET.get('page', '1')) + except ValueError: + page = 1 + + try: + paginas = paginator.page(page) + except (EmptyPage, InvalidPage): + paginas = paginator.page(paginator.num_pages) + + carrinhoIsEmpty = not('carrinho_eventos' in request.session) + + return render( + request, + 'eventos/carrinho.html', + { + 'carIsEmpty': carrinhoIsEmpty, + 'paginas': paginas, + 'query_str': '?' + request.META['QUERY_STRING'] + } + ) + +@login_required +def excluir_carrinho(request): + if 'carrinho_eventos' in request.session: + del request.session['carrinho_eventos'] + messages.info(request, u'O carrinho foi esvaziado') + return HttpResponseRedirect('../../') + +@login_required +def deleta_itens_carrinho(request): + if request.method == 'POST': + ids_selecionados = request.POST.getlist('_selected_action') + removed = 0 + if 'carrinho_eventos' in request.session: + lista = request.session['carrinho_eventos'] + for item in ids_selecionados: + lista.remove(item) + removed += 1 + if lista: + request.session['carrinho_eventos'] = lista + else: + del lista + del request.session['carrinho_eventos'] + messages.info(request, u"{0} itens removidos do carrinho".format(removed)) + return HttpResponseRedirect('.') + +@login_required +def export_csv(request): + def serialize(r, field): + value = (getattr(r, 'get_{0}_display'.format(field.name), None) or + getattr(r, field.name, "")) + if callable(value): + value = value() + if value is None: + value = "" + return unicode(value).encode('utf8') + + eventos_fields = Evento._meta.fields + equipe_fields = Equipe._meta.fields + convite_fields = Convite._meta.fields + + eventos = carrinhoOrGet_for_qs(request) + eventos.select_related('equipe', 'convite') + + if not eventos: + messages.info(request, _(u"Nenhum evento a exportar")) + return HttpResponseRedirect('../') + + max_equipe = max([e.equipe_set.count() for e in eventos]) + max_convite = max([e.convite_set.count() for e in eventos]) + + head = [f.verbose_name.encode('utf8') for f in eventos_fields + if f.name != 'id'] + head.extend([f.verbose_name.encode('utf8')+"_{0}".format(i+1) + for i in range(max_equipe) for f in Equipe._meta.fields + if f.name not in ('id', 'evento')]) + head.extend([f.verbose_name.encode('utf8')+"_{0}".format(i+1) + for i in range(max_convite) for f in Convite._meta.fields + if f.name not in ('id', 'evento')]) + head.append('total_participantes') + + response = HttpResponse(content_type='text/csv') + response['Content-Disposition'] = 'attachment; filename=eventos.csv' + + writer = csv.DictWriter(response, fieldnames=head) + writer.writeheader() + + for evento in eventos: + reg = {f.verbose_name.encode('utf8'): serialize(evento, f) + for f in Evento._meta.fields if f.name != 'id'} + reg['total_participantes'] = 0 + idx = 1 + for membro in evento.equipe_set.all(): + reg.update( + { + "{0}_{1}".format(f.verbose_name.encode('utf8'), idx): + serialize(membro, f) for f in Equipe._meta.fields + if f.name not in ('id', 'evento') + } + ) + idx += 1 + idx = 1 + for convite in evento.convite_set.all(): + reg.update( + { + "{0}_{1}".format(f.verbose_name.encode('utf8'), idx): + serialize(convite, f) for f in Convite._meta.fields + if f.name not in ('id', 'evento') + } + ) + reg['total_participantes'] += convite.qtde_participantes + idx += 1 + writer.writerow(reg) + + return response + From cbd25078e7dced10d975eea4f87e3be6f369eda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 10 May 2021 10:11:09 -0300 Subject: [PATCH 49/69] =?UTF-8?q?Tornar=20on=5Fdelete=20expl=C3=ADcito=20e?= =?UTF-8?q?m=20todos=20os=20models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/contatos/models.py | 21 +++++++++++++++------ sigi/apps/inventario/models.py | 5 +---- sigi/apps/servicos/models.py | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/sigi/apps/contatos/models.py b/sigi/apps/contatos/models.py index 200095f..6a6f217 100644 --- a/sigi/apps/contatos/models.py +++ b/sigi/apps/contatos/models.py @@ -190,10 +190,13 @@ class Telefone(models.Model): ult_alteracao = models.DateTimeField(_(u'Última alteração'), null=True, blank=True, editable=False, auto_now=True) # guarda o tipo do objeto (classe) vinculado a esse registro - content_type = models.ForeignKey(ContentType) + content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) # identificador do registro na classe vinculado a esse registro object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = generic.GenericForeignKey( + 'content_type', + 'object_id', + ) class Meta: ordering = ('numero',) @@ -224,10 +227,13 @@ class Contato(models.Model): ) # guarda o tipo do objeto (classe) vinculado a esse registro - content_type = models.ForeignKey(ContentType) + content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) # identificador do registro na classe vinculado a esse registro object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = generic.GenericForeignKey( + 'content_type', + 'object_id', + ) class Meta: ordering = ('nome',) @@ -317,10 +323,13 @@ class Endereco(models.Model): municipio.uf_filter = True # guarda o tipo do objeto (classe) vinculado a esse registro - content_type = models.ForeignKey(ContentType) + content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) # identificador do registro na classe vinculado a esse registro object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = generic.GenericForeignKey( + 'content_type', + 'object_id', + ) class Meta: ordering = ('logradouro', 'numero') diff --git a/sigi/apps/inventario/models.py b/sigi/apps/inventario/models.py index 2018769..24ecf6e 100644 --- a/sigi/apps/inventario/models.py +++ b/sigi/apps/inventario/models.py @@ -84,10 +84,7 @@ class Bem(models.Model): on_delete=models.CASCADE ) equipamento = models.ForeignKey(Equipamento, on_delete=models.CASCADE) - fornecedor = models.ForeignKey( - Fornecedor, - on_delete=models.PROTECT - ) + fornecedor = models.ForeignKey(Fornecedor, on_delete=models.PROTECT) num_serie = models.CharField( _(u'número de série'), max_length=64, diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index 3fe7d36..ec1733f 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -215,7 +215,7 @@ class CasaAtendida(Orgao): class CasaManifesta(models.Model): - casa_legislativa = models.OneToOneField(Orgao) + casa_legislativa = models.OneToOneField(Orgao, on_delete=models.CASCADE) data_manifestacao = models.DateTimeField(auto_now_add=True) data_atualizacao = models.DateTimeField(auto_now=True) informante = models.CharField(_(u'Nome do informante'), max_length=100, blank=True) From 0b63d7c4ecf0294d79561538a1d6abf64c9b0bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 10 May 2021 11:38:15 -0300 Subject: [PATCH 50/69] =?UTF-8?q?Bug=20na=20exporta=C3=A7=C3=A3o=20de=20co?= =?UTF-8?q?nvenios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/admin.py | 30 +--- .../templates/convenios/carrinho.html | 170 +++++++++--------- sigi/apps/convenios/views.py | 25 ++- 3 files changed, 115 insertions(+), 110 deletions(-) diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 601079d..ad4d7bc 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -110,28 +110,16 @@ class ConvenioAdmin(BaseModelAdmin): link_sigad.allow_tags = True def changelist_view(self, request, extra_context=None): - def normaliza_data(nome_param): - import re - if nome_param in request.GET: - value = request.GET.get(nome_param, '') - if value == '': - del request.GET[nome_param] - elif re.match('^\d*$', value): # Year only - # Complete with january 1st - request.GET[nome_param] = "%s-01-01" % value - elif re.match('^\d*\D\d*$', value): # Year and month - # Complete with 1st day of month - request.GET[nome_param] = '%s-01' % value - + from sigi.apps.convenios.views import normaliza_data request.GET._mutable = True - normaliza_data('data_retorno_assinatura__gte') - normaliza_data('data_retorno_assinatura__lte') - normaliza_data('data_sigad__gte') - normaliza_data('data_sigad__lte') - normaliza_data('data_sigi__gte') - normaliza_data('data_sigi__lte') - normaliza_data('data_solicitacao__gte') - normaliza_data('data_solicitacao__lte') + normaliza_data(request.GET, 'data_retorno_assinatura__gte') + normaliza_data(request.GET, 'data_retorno_assinatura__lte') + normaliza_data(request.GET, 'data_sigad__gte') + normaliza_data(request.GET, 'data_sigad__lte') + normaliza_data(request.GET, 'data_sigi__gte') + normaliza_data(request.GET, 'data_sigi__lte') + normaliza_data(request.GET, 'data_solicitacao__gte') + normaliza_data(request.GET, 'data_solicitacao__lte') request.GET._mutable = False return super(ConvenioAdmin, self).changelist_view( diff --git a/sigi/apps/convenios/templates/convenios/carrinho.html b/sigi/apps/convenios/templates/convenios/carrinho.html index 9e8cae8..e80c224 100644 --- a/sigi/apps/convenios/templates/convenios/carrinho.html +++ b/sigi/apps/convenios/templates/convenios/carrinho.html @@ -21,8 +21,8 @@ {% block action %}deleta_itens_carrinho{% endblock %} {% block tabela %} - - +
    + {%if not carIsEmpty%} {% for convenio in paginas.object_list %} - + {%if not carIsEmpty%} @@ -56,107 +56,103 @@ {% endblock %} {% block botoes %} -
    - - -
    -
    {% csrf_token %} -
    - {% trans 'Relatório por' %} -
      -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    + +
    +
    + {% csrf_token %} +
    + {% trans 'Relatório por' %} +
      +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    {% trans 'Com data de aceite? (Equipada)' %}
    • - - -
    • + + +
    • - - -
    • + + +
    -
      -
    • -
    - + +
    -
    +
    {% csrf_token %} -
    {% trans 'Escolha os atributos para exportar' %} -
      -
    • - - + {% trans 'Escolha os atributos para exportar' %} +
        +
      • + + - -
      • -
      • - - {% trans 'Nº Processo' %} +
      • +
      • + + - -
      • -
      • - - {% trans 'Nº Convênio' %} +
      • +
      • + + - -
      • -
      • - - {% trans 'Projeto' %} +
      • +
      • + + - -
      • -
      • - - {% trans 'Casa Legislativa' %} +
      • +
      • + + - -
      • -
      • - - {% trans 'Data de Adesão' %} +
      • +
      • + + - -
      • -
      • - - {% trans 'Data de Convênio' %} +
      • +
      • + + - -
      • -
      • - - {% trans 'Data da Publicação no Diário Oficial' %} +
      • +
      • + + - -
      • -
      -
    -
      -
    • -
    - -
    + + + +
    + + +
    {% endblock %} diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index 3ae3e97..d9ae58f 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -36,10 +36,32 @@ def query_ordena(qs, o, ot): qs = qs.order_by("-" + aux) return qs +def normaliza_data(get, nome_param): + import re + if nome_param in get: + value = get.get(nome_param, '') + if value == '': + del get[nome_param] + elif re.match('^\d*$', value): # Year only + # Complete with january 1st + get[nome_param] = "%s-01-01" % value + elif re.match('^\d*\D\d*$', value): # Year and month + # Complete with 1st day of month + get[nome_param] = '%s-01' % value def get_for_qs(get, qs): kwargs = {} ids = 0 + get._mutable = True + normaliza_data(get, 'data_retorno_assinatura__gte') + normaliza_data(get, 'data_retorno_assinatura__lte') + normaliza_data(get, 'data_sigad__gte') + normaliza_data(get, 'data_sigad__lte') + normaliza_data(get, 'data_sigi__gte') + normaliza_data(get, 'data_sigi__lte') + normaliza_data(get, 'data_solicitacao__gte') + normaliza_data(get, 'data_solicitacao__lte') + get._mutable = False for k, v in get.iteritems(): if k not in ['page', 'pop', 'q', '_popup']: if not k == 'o': @@ -50,8 +72,7 @@ def get_for_qs(get, qs): if(str(k) == 'ids'): ids = 1 break - qs = qs.filter(**kwargs) - + qs = qs.filter(**kwargs) if ids: query = 'id IN (' + kwargs['ids'].__str__() + ')' qs = Convenio.objects.extra(where=[query]) From 06764e63af1c18f8b4bc330516c0a5941d2f9377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 10 May 2021 16:41:31 -0300 Subject: [PATCH 51/69] =?UTF-8?q?Adequa=C3=A7=C3=A3o=20exporta=C3=A7=C3=A3?= =?UTF-8?q?o=20eventos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/eventos/views.py | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/sigi/apps/eventos/views.py b/sigi/apps/eventos/views.py index 164f644..ec68f43 100644 --- a/sigi/apps/eventos/views.py +++ b/sigi/apps/eventos/views.py @@ -306,10 +306,6 @@ def export_csv(request): value = "" return unicode(value).encode('utf8') - eventos_fields = Evento._meta.fields - equipe_fields = Equipe._meta.fields - convite_fields = Convite._meta.fields - eventos = carrinhoOrGet_for_qs(request) eventos.select_related('equipe', 'convite') @@ -318,17 +314,13 @@ def export_csv(request): return HttpResponseRedirect('../') max_equipe = max([e.equipe_set.count() for e in eventos]) - max_convite = max([e.convite_set.count() for e in eventos]) - head = [f.verbose_name.encode('utf8') for f in eventos_fields - if f.name != 'id'] + head = [f.verbose_name.encode('utf8') for f in Evento._meta.fields] head.extend([f.verbose_name.encode('utf8')+"_{0}".format(i+1) for i in range(max_equipe) for f in Equipe._meta.fields if f.name not in ('id', 'evento')]) - head.extend([f.verbose_name.encode('utf8')+"_{0}".format(i+1) - for i in range(max_convite) for f in Convite._meta.fields + head.extend([f.verbose_name.encode('utf8') for f in Convite._meta.fields if f.name not in ('id', 'evento')]) - head.append('total_participantes') response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename=eventos.csv' @@ -338,8 +330,7 @@ def export_csv(request): for evento in eventos: reg = {f.verbose_name.encode('utf8'): serialize(evento, f) - for f in Evento._meta.fields if f.name != 'id'} - reg['total_participantes'] = 0 + for f in Evento._meta.fields} idx = 1 for membro in evento.equipe_set.all(): reg.update( @@ -350,18 +341,15 @@ def export_csv(request): } ) idx += 1 - idx = 1 for convite in evento.convite_set.all(): reg.update( - { - "{0}_{1}".format(f.verbose_name.encode('utf8'), idx): - serialize(convite, f) for f in Convite._meta.fields - if f.name not in ('id', 'evento') - } + {f.verbose_name.encode('utf8'): serialize(convite, f) + for f in Convite._meta.fields + if f.name not in ('id', 'evento')} ) - reg['total_participantes'] += convite.qtde_participantes - idx += 1 - writer.writerow(reg) + writer.writerow(reg) + if evento.convite_set.count() == 0: + writer.writerow(reg) return response From 42ab9e5711b4105a76413b24a892c485c9bd8fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 11 May 2021 11:52:22 -0300 Subject: [PATCH 52/69] =?UTF-8?q?Importar=20dados=20de=20servi=C3=A7os=20S?= =?UTF-8?q?EIT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/admin.py | 2 +- .../management/commands/importa_servico.py | 159 ++++++++++++++++++ 2 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 sigi/apps/servicos/management/commands/importa_servico.py diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 1204ba0..c09d079 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -319,7 +319,7 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): actions = ['adicionar_casas', ] inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, ConveniosInline, ServicoInline, OcorrenciaInline,) - list_display = ('sigla', 'nome', 'get_uf', 'get_gerentes', 'get_convenios', + list_display = ('id', 'sigla', 'nome', 'get_uf', 'get_gerentes', 'get_convenios', 'get_servicos') list_display_links = ('sigla', 'nome',) list_filter = ('tipo', ('gerentes_interlegis', GerentesInterlegisFilter), diff --git a/sigi/apps/servicos/management/commands/importa_servico.py b/sigi/apps/servicos/management/commands/importa_servico.py new file mode 100644 index 0000000..64b7c1a --- /dev/null +++ b/sigi/apps/servicos/management/commands/importa_servico.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- + +import csv +import os +from datetime import datetime, date +from django.core.management.base import BaseCommand, CommandError +from sigi.apps.utils import to_ascii +from sigi.apps.servicos.models import Servico, TipoServico +from sigi.apps.casas.models import Orgao, Funcionario + +class Command(BaseCommand): + args = "nome_do_arquivo.txt" + help = u""" +Importa dados de serviços de arquivos TXT gerados pela COTIN. +""" + def handle(self, *args, **options): + if len(args) != 1: + raise CommandError(u"Informe UM arquivo TXT a importar") + file_name = args[0] + + self.stdout.write(u'Verificando estrutura do arquivo...') + if not os.path.isfile(file_name): + raise CommandError(u"Arquivo '%s' não encontrado" % file_name) + + with open(file_name, 'r') as f: + reader = csv.DictReader(f, delimiter=" ") + if (not 'TEMPLATE' in reader.fieldnames or + not 'NAME' in reader.fieldnames or + not 'COD_ORGAO' in reader.fieldnames): + raise CommandError(u"Formato inválido do arquivo.") + self.stdout.write(u'Estrutura parece ok.') + self.stdout.write("Preparando dados...") + casas = { + to_ascii(c.municipio.nome).replace(' ','').replace('-','').lower() + + '-' + to_ascii(c.municipio.uf.sigla).lower(): c.pk + for c in Orgao.objects.filter(tipo__sigla='CM') + } + casas.update( + {'al-'+to_ascii(c.municipio.uf.sigla).lower(): c.pk + for c in Orgao.objects.filter(tipo__sigla='AL')} + ) + casas.update( + {'tce-'+to_ascii(c.municipio.uf.sigla).lower(): c.pk + for c in Orgao.objects.filter(tipo__sigla='TCE')} + ) + self.stdout.write("Processando...") + + lista_tipos = set() + agora = datetime.now() + subdominios = {'PM': 'www', 'SAPL': 'sapl', + 'EmailLeg': 'correioadm', 'edem': 'edemocracia', + 'LEGBR': '', 'GOVBR': ''} + can_deactivate = True + + for rec in reader: + nome = rec['NAME'] + sigla = rec['TEMPLATE'] + cod_orgao = rec['COD_ORGAO'] + + if sigla == 'DNS': + dominio = nome + if '.leg.br' in nome: + nome = nome.replace('.leg.br', '') + sigla = 'LEGBR' + elif '.gov.br' in nome: + nome = nome.replace('.gov.br', '') + if nome.startswith('camara'): + nome = nome.replace('camara', '') + if nome.startswith('cm'): + nome = nome.replace('cm','') + sigla = 'GOVBR' + nome = nome.replace('.', '-') + else: + dominio = nome.replace('-','.')+'.leg.br' + + url = u"https://{subdominio}.{dominio}".format( + subdominio=subdominios[sigla], + dominio=dominio + ) + tipo_servico = TipoServico.objects.get(sigla=sigla) + lista_tipos.add(tipo_servico) + + if cod_orgao is not None: + if cod_orgao == '*': + self.stdout.write( + "{template} {name} {cod_orgao} " + "registro ignorado".format( + template=rec['TEMPLATE'], + name=rec['NAME'], + cod_orgao=rec['COD_ORGAO'] + ) + ) + continue + else: + casa = Orgao.objects.get(id=cod_orgao) + else: + if nome not in casas: + self.stdout.write( + "{template} {name} {cod_orgao} " + "orgao nao encontrado ({s})".format( + template=rec['TEMPLATE'], + name=rec['NAME'], + cod_orgao=rec['COD_ORGAO'], + s=nome + ) + ) + can_deactivate = False + continue + casa = Orgao.objects.get(id=casas[nome]) + + try: + contato, created = casa.funcionario_set.get_or_create( + setor='contato_interlegis', + defaults={'nome': u"<>"} + ) + except Funcionario.MultipleObjectsReturned: + contato = casa.funcionario_set.filter( + setor='contato_interlegis', + ).first() # Hack - pega sempre o primeiro + + try: + servico, created = casa.servico_set.get_or_create( + tipo_servico=tipo_servico, + data_desativacao=None, + defaults={ + 'contato_tecnico': contato, + 'contato_administrativo': contato, + 'url': url, + 'hospedagem_interlegis': True, + 'data_ativacao': date.today() + } + ) + servico.save() + except Servico.MultipleObjectsReturned: + self.stdout.write( + u"{template} {name} mais de um servico encontrado " + u"({s})".format(template=rec['TEMPLATE'], + name=rec['NAME'], s=nome) + ) + can_deactivate = False + + + if can_deactivate: + for tipo_servico in lista_tipos: + tipo_servico.servico_set.filter( + data_alteracao__lt=agora + ).update( + data_desativacao=agora, + motivo_desativacao=(u"[AUTOMÁTICO] Não consta da lista " + u"da COTIN") + ) + else: + self.stdout.write( + self.style.ERROR(u"Os serviços excendentes não podem ser " + u"desativados porque foram encontradas " + u"inconsistências no arquivo de origem") + ) + + From d00c38061c8876c730bd37386b64a1e487c16eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 12 May 2021 15:25:52 -0300 Subject: [PATCH 53/69] =?UTF-8?q?Importa=C3=A7=C3=A3o=20servi=C3=A7os=20SE?= =?UTF-8?q?IT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/commands/importa_servico.py | 120 ++++++++++++------ 1 file changed, 82 insertions(+), 38 deletions(-) diff --git a/sigi/apps/servicos/management/commands/importa_servico.py b/sigi/apps/servicos/management/commands/importa_servico.py index 64b7c1a..8b76105 100644 --- a/sigi/apps/servicos/management/commands/importa_servico.py +++ b/sigi/apps/servicos/management/commands/importa_servico.py @@ -27,11 +27,12 @@ Importa dados de serviços de arquivos TXT gerados pela COTIN. if (not 'TEMPLATE' in reader.fieldnames or not 'NAME' in reader.fieldnames or not 'COD_ORGAO' in reader.fieldnames): + print reader.fieldnames raise CommandError(u"Formato inválido do arquivo.") self.stdout.write(u'Estrutura parece ok.') self.stdout.write("Preparando dados...") casas = { - to_ascii(c.municipio.nome).replace(' ','').replace('-','').lower() + to_ascii(c.municipio.nome).replace(' ','').replace('-','').replace("'", '').lower() + '-' + to_ascii(c.municipio.uf.sigla).lower(): c.pk for c in Orgao.objects.filter(tipo__sigla='CM') } @@ -53,29 +54,35 @@ Importa dados de serviços de arquivos TXT gerados pela COTIN. can_deactivate = True for rec in reader: - nome = rec['NAME'] - sigla = rec['TEMPLATE'] + name = rec['NAME'] + template = rec['TEMPLATE'] cod_orgao = rec['COD_ORGAO'] - if sigla == 'DNS': - dominio = nome - if '.leg.br' in nome: - nome = nome.replace('.leg.br', '') + if template == 'DNS': + s = name.split('.') + nome_casa = s[0]+"-"+s[1] + dominio = s[0] + sufixo = ".".join(s[1:]) + if '.leg.br' in name: sigla = 'LEGBR' - elif '.gov.br' in nome: - nome = nome.replace('.gov.br', '') - if nome.startswith('camara'): - nome = nome.replace('camara', '') - if nome.startswith('cm'): - nome = nome.replace('cm','') + elif '.gov.br' in name: sigla = 'GOVBR' - nome = nome.replace('.', '-') else: - dominio = nome.replace('-','.')+'.leg.br' + s = name.split("-") + nome_casa = name + dominio = name[0] + sufixo = ".".join(s[1:]) + '.leg.br' + sigla = template - url = u"https://{subdominio}.{dominio}".format( + if nome_casa.startswith('camara'): + nome_casa = nome_casa.replace('camara', '') + if nome_casa.startswith('cm'): + nome_casa = nome_casa.replace('cm','') + + url = u"https://{subdominio}.{dominio}.{sufixo}".format( subdominio=subdominios[sigla], - dominio=dominio + dominio=dominio, + sufixo=sufixo ) tipo_servico = TipoServico.objects.get(sigla=sigla) lista_tipos.add(tipo_servico) @@ -85,33 +92,67 @@ Importa dados de serviços de arquivos TXT gerados pela COTIN. self.stdout.write( "{template} {name} {cod_orgao} " "registro ignorado".format( - template=rec['TEMPLATE'], - name=rec['NAME'], - cod_orgao=rec['COD_ORGAO'] + template=template, + name=name, + cod_orgao=cod_orgao ) ) continue else: - casa = Orgao.objects.get(id=cod_orgao) + try: + casa = Orgao.objects.get(id=cod_orgao) + except Orgao.DoesNotExist: + self.stdout.write( + "{template} {name} {cod_orgao} " + "codigo inexistente".format( + template=template, + name=name, + cod_orgao=cod_orgao + ) + ) + can_deactivate = False + continue else: - if nome not in casas: - self.stdout.write( - "{template} {name} {cod_orgao} " - "orgao nao encontrado ({s})".format( - template=rec['TEMPLATE'], - name=rec['NAME'], - cod_orgao=rec['COD_ORGAO'], - s=nome + if nome_casa in casas: + casa = Orgao.objects.get(id=casas[nome_casa]) + else: + # Nome pode divergir, vamos procurar pelo domínio + try: + servico = Servico.objects.get( + url__icontains=dominio, + tipo_servico=tipo_servico ) - ) - can_deactivate = False - continue - casa = Orgao.objects.get(id=casas[nome]) + servico.save() + continue + except (Servico.DoesNotExist, + Servico.MultipleObjectsReturned): + # tenta descobrir outro serviço do mesmo domínio + casa = None + for servico in Servico.objects.filter( + url__icontains=dominio): + if casa is None: + casa = servico.casa_legislativa + elif casa != servico.casa_legislativa: + # Mais de uma casa usando o mesmo domínio!!! + casa = None + break + if casa is None: # Impossível identificar a casa + self.stdout.write( + "{template} {name} {cod_orgao} " + "orgao nao encontrado ({s})".format( + template=template, + name=name, + cod_orgao=cod_orgao, + s=nome_casa + ) + ) + can_deactivate = False + continue try: contato, created = casa.funcionario_set.get_or_create( setor='contato_interlegis', - defaults={'nome': u"<>"} + defaults={'nome': u"<>"} ) except Funcionario.MultipleObjectsReturned: contato = casa.funcionario_set.filter( @@ -133,13 +174,16 @@ Importa dados de serviços de arquivos TXT gerados pela COTIN. servico.save() except Servico.MultipleObjectsReturned: self.stdout.write( - u"{template} {name} mais de um servico encontrado " - u"({s})".format(template=rec['TEMPLATE'], - name=rec['NAME'], s=nome) + u"{template} {name} {cod_orgao} mais de um servico " + u"encontrado ({s})".format( + template=template, + name=name, + cod_orgao=cod_orgao, + s=nome_casa + ) ) can_deactivate = False - if can_deactivate: for tipo_servico in lista_tipos: tipo_servico.servico_set.filter( From 7d14171ee8b5b4f584a45bc4dd62d8fe4b4cea27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 17 May 2021 23:37:43 -0300 Subject: [PATCH 54/69] Lista de gerentes interlegis --- .../templates/casas/gerentes_interlegis.html | 57 +++++++ .../casas/gerentes_interlegis_pdf.html | 143 ++++++++++++++++++ sigi/apps/casas/urls.py | 2 + sigi/apps/casas/views.py | 62 ++++++++ sigi/apps/home/templatetags/menu_conf.yaml | 2 + 5 files changed, 266 insertions(+) create mode 100644 sigi/apps/casas/templates/casas/gerentes_interlegis.html create mode 100644 sigi/apps/casas/templates/casas/gerentes_interlegis_pdf.html diff --git a/sigi/apps/casas/templates/casas/gerentes_interlegis.html b/sigi/apps/casas/templates/casas/gerentes_interlegis.html new file mode 100644 index 0000000..289a8e0 --- /dev/null +++ b/sigi/apps/casas/templates/casas/gerentes_interlegis.html @@ -0,0 +1,57 @@ +{% extends "admin/base_site.html" %} +{% load i18n admin_static %} +{% load static from staticfiles %} + +{% block coltype %}colMS{% endblock %} + +{% block content_title %}

    {% blocktrans %}Gerentes Interlegis{% endblocktrans %}

    {% endblock %} + +{% block content %} + + +
    + {% for linha in gerentes %} +
    +
    +

    {{ linha.gerente.nome_completo }} {{ linha.gerente.casas_que_gerencia.count }}

    +
    +
    + +
    + {% for uf in linha.ufs %} +
    +
      + {% for casa in uf.2 %} +
    • + {{ casa }}
    • + {% endfor %} +
    +
    + {% endfor %} +
    +
    +
    + {% endfor %} +
    +{% endblock %} \ No newline at end of file diff --git a/sigi/apps/casas/templates/casas/gerentes_interlegis_pdf.html b/sigi/apps/casas/templates/casas/gerentes_interlegis_pdf.html new file mode 100644 index 0000000..c0dd300 --- /dev/null +++ b/sigi/apps/casas/templates/casas/gerentes_interlegis_pdf.html @@ -0,0 +1,143 @@ +{% load static from staticfiles %} +{% load i18n %} + + + + + Casa Legislativa + + + +
    @@ -38,7 +38,7 @@
    + + + + + +
    +

    {% trans 'SENADO FEDERAL' %}

    +

    {% trans 'ILB - Interlegis' %}

    +

    {% trans 'Gerentes Interlegis' %}

    +
    + + + + + + + + + + + {% for linha in gerentes %} + {% for uf in linha.ufs %} + + {% if forloop.first %} + + {% else %} + + {% endif %} + + + + {% endfor %} + + + + + {% endfor %} +
    Gerente InterlegisUFNúmero de casas
    {{ linha.gerente.nome_completo }} {{ uf.1 }}{{ uf.2.count }}
    Total de casas atendidas por {{ linha.gerente.nome_completo }}{{ linha.gerente.casas_que_gerencia.count }}
    + + + + diff --git a/sigi/apps/casas/urls.py b/sigi/apps/casas/urls.py index 9d73253..38f0687 100644 --- a/sigi/apps/casas/urls.py +++ b/sigi/apps/casas/urls.py @@ -52,4 +52,6 @@ urlpatterns = patterns( # Atualização por CSV url(r'^orgao/importa/$', login_required(importa_casas.as_view()), name='importar-casas'), + url(r'^gerentes/$', 'gerentes_interlegis', + name='gerentes_interlegis'), ) diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index ffb289f..694e84b 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -1035,3 +1035,65 @@ def painel_relacionamento(request): return render(request, 'casas/resumo_carteira_snippet.html', context) return render(request, 'casas/painel.html', context) + +@login_required +def gerentes_interlegis(request): + formato = request.GET.get('fmt', 'html') + inclui_casas = (request.GET.get('casas', 'no') == 'yes') + gerentes = Servidor.objects.exclude( + casas_que_gerencia=None).select_related('casas_que_gerencia') + dados = [] + for gerente in gerentes: + row = {'gerente': gerente, 'ufs': []} + for uf in (gerente.casas_que_gerencia.distinct('municipio__uf__sigla') + .order_by('municipio__uf__sigla') + .values_list('municipio__uf__sigla', 'municipio__uf__nome') + ): + row['ufs'].append(( + uf[0], + uf[1], + gerente.casas_que_gerencia.filter(municipio__uf__sigla=uf[0]) + )) + dados.append(row) + + if formato == 'pdf': + return render_to_pdf( + 'casas/gerentes_interlegis_pdf.html', + {'gerentes': dados} + ) + elif formato == 'csv': + response = HttpResponse(content_type='text/csv') + response['Content-Disposition'] = ('attachment; ' + 'filename="gerentes_interlegis.csv"') + fieldnames = ['gerente', 'total_casas', 'uf', 'total_casas_uf'] + if inclui_casas: + fieldnames.append('casa_legislativa') + writer = csv.DictWriter(response, fieldnames=fieldnames) + writer.writeheader() + for linha in dados: + rec = { + 'gerente': linha['gerente'].nome_completo.encode('utf8'), + 'total_casas': linha['gerente'].casas_que_gerencia.count() + } + for uf in linha['ufs']: + rec['uf'] = uf[1].encode('utf8') + rec['total_casas_uf'] = uf[2].count() + if inclui_casas: + for casa in uf[2]: + rec['casa_legislativa'] = casa.nome.encode('utf8') + writer.writerow(rec) + rec['gerente'] = '' + rec['total_casas'] = '' + rec['uf'] = '' + rec['total_casas_uf'] = '' + else: + writer.writerow(rec) + rec['gerente'] = '' + rec['total_casas'] = '' + return response + + return render( + request, + 'casas/gerentes_interlegis.html', + {'gerentes': dados} + ) diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 271306a..0c51f7e 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -23,6 +23,8 @@ main_menu: url: casas/carteira - title: Organizar relacionamentos url: casas/portfolio/ + - title: Lista de gerentes + url: casas/gerentes/ - title: Convênios children: - title: Convênios From 038acc5f22d9f28af3a685a985ce9a99727ce959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 24 May 2021 09:49:07 -0300 Subject: [PATCH 55/69] =?UTF-8?q?Ajusta=20rotina=20de=20verifica=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20servi=C3=A7os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0008_auto_20210519_1117.py | 50 ++++ sigi/apps/servicos/models.py | 218 +++++++++++++----- 2 files changed, 215 insertions(+), 53 deletions(-) create mode 100644 sigi/apps/servicos/migrations/0008_auto_20210519_1117.py diff --git a/sigi/apps/servicos/migrations/0008_auto_20210519_1117.py b/sigi/apps/servicos/migrations/0008_auto_20210519_1117.py new file mode 100644 index 0000000..9e153e6 --- /dev/null +++ b/sigi/apps/servicos/migrations/0008_auto_20210519_1117.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servicos', '0007_auto_20210416_0841'), + ] + + operations = [ + migrations.AlterField( + model_name='servico', + name='data_ultimo_uso', + field=models.DateField(help_text='Data em que o servi\xe7o foi utilizado pela Casa Legislativa pela \xfaltima vez', null=True, verbose_name='Data da \xfaltima utiliza\xe7\xe3o', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='servico', + name='erro_atualizacao', + field=models.TextField(help_text='Erro ocorrido na \xfaltima tentativa de verificar a data de \xfaltima atualiza\xe7\xe3o do servi\xe7o', verbose_name='Erro na atualiza\xe7\xe3o', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='tiposervico', + name='modo', + field=models.CharField(max_length=1, verbose_name='modo de presta\xe7\xe3o do servi\xe7o', choices=[(b'H', 'Hospedagem'), (b'R', 'Registro')]), + preserve_default=True, + ), + migrations.AlterField( + model_name='tiposervico', + name='nome', + field=models.CharField(max_length=60, verbose_name='nome'), + preserve_default=True, + ), + migrations.AlterField( + model_name='tiposervico', + name='sigla', + field=models.CharField(max_length=b'12', verbose_name='sigla'), + preserve_default=True, + ), + migrations.AlterField( + model_name='tiposervico', + name='string_pesquisa', + field=models.TextField(help_text='Par\xe2metros da pesquisa para averiguar a data da \xfaltima atualiza\xe7\xe3o do servi\xe7o. Formato:
    • /caminho/da/pesquisa/?parametros [xml|json] campo.de.data
    • ', verbose_name='string de pesquisa', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index ec1733f..af86fc3 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -14,11 +14,22 @@ class TipoServico(models.Model): email_help = u'''Use:
      {url} para incluir a URL do serviço,
      {senha} para incluir a senha inicial do serviço''' - nome = models.CharField(_(u'Nome'), max_length=60) - sigla = models.CharField(_(u'Sigla'), max_length='12') - modo = models.CharField(_(u'Modo de prestação do serviço'), max_length=1, choices=MODO_CHOICES) - string_pesquisa = models.CharField(_(u'String de pesquisa'), blank=True, max_length=200, - help_text=_(u'Sufixo para pesquisa RSS para averiguar a data da última atualização do serviço')) + string_pesquisa_help = (u"Parâmetros da pesquisa para averiguar a data da " + u"última atualização do serviço. Formato:
      " + u"
      • /caminho/da/pesquisa/?parametros " + u"[xml|json] campo.de.data
      • ") + nome = models.CharField(_(u'nome'), max_length=60) + sigla = models.CharField(_(u'sigla'), max_length='12') + modo = models.CharField( + _(u'modo de prestação do serviço'), + max_length=1, + choices=MODO_CHOICES + ) + string_pesquisa = models.TextField( + _(u'string de pesquisa'), + blank=True, + help_text=string_pesquisa_help + ) template_email_ativa = models.TextField(_(u'Template de email de ativação'), help_text=email_help, blank=True) template_email_altera = models.TextField(_(u'Template de email de alteração'), help_text=email_help, blank=True) template_email_desativa = models.TextField(_(u'Template de email de desativação'), help_text=email_help + _(u'
        {motivo} para incluir o motivo da desativação do serviço'), blank=True) @@ -60,31 +71,143 @@ class Servico(models.Model): related_name='contato_administrativo' ) url = models.URLField(_(u'URL do serviço'), blank=True) - hospedagem_interlegis = models.BooleanField(_(u'Hospedagem no Interlegis?'), default=False) - nome_servidor = models.CharField(_(u'Hospedado em'), max_length=60, blank=True, - help_text=_(u'Se hospedado no Interlegis, informe o nome do servidor.
        Senão, informe o nome do provedor de serviços.')) - porta_servico = models.PositiveSmallIntegerField(_(u'Porta de serviço (instância)'), blank=True, null=True) - senha_inicial = models.CharField(_(u'Senha inicial'), max_length=33, blank=True) + hospedagem_interlegis = models.BooleanField( + _(u'Hospedagem no Interlegis?'), + default=False + ) + nome_servidor = models.CharField( + _(u'Hospedado em'), + max_length=60, + blank=True, + help_text=_(u'Se hospedado no Interlegis, informe o nome do servidor.' + u'
        Senão, informe o nome do provedor de serviços.') + ) + porta_servico = models.PositiveSmallIntegerField( + _(u'Porta de serviço (instância)'), + blank=True, + null=True + ) + senha_inicial = models.CharField( + _(u'Senha inicial'), + max_length=33, + blank=True + ) data_ativacao = models.DateField(_(u'Data de ativação'), default=date.today) - data_alteracao = models.DateField(_(u'Data da última alteração'), blank=True, null=True, auto_now=True) - data_desativacao = models.DateField(_(u'Data de desativação'), blank=True, null=True) - motivo_desativacao = models.TextField(_(u'Motivo da desativação'), blank=True) - data_ultimo_uso = models.DateField(_(u'Data da última utilização'), blank=True, null=True, - help_text=_(u'Data em que o serviço foi utilizado pela Casa Legislativa pela última vez
        NÃO É ATUALIZADO AUTOMATICAMENTE!')) - erro_atualizacao = models.CharField(_(u"Erro na atualização"), blank=True, max_length=200, - help_text=_(u"Erro ocorrido na última tentativa de atualizar a data de último acesso")) + data_alteracao = models.DateField( + _(u'Data da última alteração'), + blank=True, + null=True, + auto_now=True + ) + data_desativacao = models.DateField( + _(u'Data de desativação'), + blank=True, + null=True + ) + motivo_desativacao = models.TextField( + _(u'Motivo da desativação'), + blank=True + ) + data_ultimo_uso = models.DateField( + _(u'Data da última utilização'), + blank=True, + null=True, + help_text=_(u'Data em que o serviço foi utilizado pela Casa Legislativa' + u' pela última vez') + ) + erro_atualizacao = models.TextField( + _(u"Erro na atualização"), + blank=True, + help_text=_(u"Erro ocorrido na última tentativa de verificar a data " + u"de última atualização do serviço") + ) # casa_legislativa.casa_uf_filter = True def atualiza_data_uso(self): - def reset(erro=u"", comment=u""): - if self.data_ultimo_uso is None and not erro: - return - self.data_ultimo_uso = None - self.erro_atualizacao = comment + '
        ' + erro - self.save() + import requests + from xml.dom.minidom import parseString + + def reset(): + if self.data_ultimo_uso is not None: + self.data_ultimo_uso = None + self.erro_atualizacao = '' + self.save() return + def ultimo_uso(url, string_pesquisa): + param_pesquisa = string_pesquisa.split(" ") + if len(param_pesquisa) != 3: + return { + 'data': '', + 'erro':_(u"String de pesquisa mal configurada"), + 'comment':_(u"Corrija a string de pesquisa") + } + campos = [int(s) if s.isdigit() else s for s in + param_pesquisa[2].split('.')] + + url += param_pesquisa[0] + + try: # Captura erros de conexão + req = requests.get(url) + except Exception as e: + return { + 'data': '', + 'erro':str(e), + 'comment':_(u"Não foi possível conectar com o servidor. " + u"Pode estar fora do ar ou não ser " + u"um {tipo}".format( + tipo=self.tipo_servico.nome)) + } + + if req.status_code != 200: + return { + 'data': '', + 'erro': req.reason, + 'comment':_(u"Não foi possível receber os dados do " + u"servidor. O acesso pode ter sido negado.") + } + + try: + if param_pesquisa[1] == 'xml': + data = parseString(req.content) + elif param_pesquisa[1] == 'json': + data = req.json() + else: + return { + 'data': '', + 'erro': _(u'String de pesquisa mal configurada'), + 'comment': '' + } + + for c in campos: + if isinstance(c, int): + if (len(data)-1) < c: + return { + 'data': '', + 'erro': _(u'Sem dados para verificação'), + 'comment': _(u'Parece que nunca foi usado') + } + data = data[c] + else: + if param_pesquisa[1] == 'xml': + data = data.getElementsByTagName(c) + else: + data = data[c] + + if param_pesquisa[1] == 'xml': + data = data.firstChild.nodeValue + data = data[:10] + data = data.replace('/','-') + return {'data': data, 'erro': '', 'comment': ''} + except Exception as e: + return { + 'data': '', + 'erro': str(e), + 'comment': _(u"Parece que não é um {tipo}".format( + tipo=self.tipo_servico.nome)) + } + if self.tipo_servico.string_pesquisa == "": reset() return @@ -93,46 +216,35 @@ class Servico(models.Model): if not url: reset() + self.erro_atualizacao = _(u"Serviço sem URL") + self.save() return if url[-1] != '/': url += '/' - url += self.tipo_servico.string_pesquisa - import urllib2 - from xml.dom.minidom import parseString + resultados = [] - try: # Captura erros de conexão - try: # Tentar conxão sem proxy - req = urllib2.urlopen(url=url, timeout=5) - except: # Tentar com proxy - proxy = urllib2.ProxyHandler() - opener = urllib2.build_opener(proxy) - req = opener.open(fullurl=url, timeout=5) - except Exception as e: - reset(erro=str(e), comment=_(u'Não foi possível conectar com o servidor. Pode estar fora do ar ou não ser um ') + - self.tipo_servico.nome) - return + for string_pesquisa in self.tipo_servico.string_pesquisa.splitlines(): + resultados.append(ultimo_uso(url, string_pesquisa)) - try: - rss = req.read() - except Exception as e: - reset(erro=str(e), comment=_(u'Não foi possível receber os dados do servidor. O acesso pode ter sido negado.')) - return + data = max([r['data'] for r in resultados]) - try: - xml = parseString(rss) - items = xml.getElementsByTagName('item') - first_item = items[0] - date_list = first_item.getElementsByTagName('dc:date') - date_item = date_list[0] - date_text = date_item.firstChild.nodeValue - self.data_ultimo_uso = date_text[:10] # Apenas YYYY-MM-DD + if data == '': + # Nenhuma busca deu resultado, guardar log de erro + self.data_ultimo_uso = None + self.erro_atualizacao = "
        ".join(set( + [u"{erro} ({comment})".format(erro=r['erro'], + comment=r['comment']) + for r in resultados if r['erro'] != '' and r['comment'] != '' + ])) + self.save() + else: + # Atualiza a maior data de atualização + self.data_ultimo_uso = data[:10] # Apenas YYYY-MM-DD self.erro_atualizacao = "" self.save() - except Exception as e: - reset(erro=str(e), comment=_(u'A resposta do servidor não é compatível com %s. Pode ser outro software que está sendo usado') % - self.tipo_servico.nome) + return def __unicode__(self): From 107de2ce3626e08a9e2ad6dc24aaeb822e050b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 24 May 2021 23:20:51 -0300 Subject: [PATCH 56/69] =?UTF-8?q?Novos=20filtros=20para=20servi=C3=A7os=20?= =?UTF-8?q?e=20conv=C3=AAnios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/admin.py | 5 +++- sigi/apps/servicos/admin.py | 50 ++++++++++++++++++++++++++++++++-- sigi/apps/servidores/models.py | 4 ++- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index ad4d7bc..ce5a6fe 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -12,6 +12,7 @@ from sigi.apps.convenios.views import adicionar_convenios_carrinho from sigi.apps.utils import queryset_ascii from sigi.apps.utils.base_admin import BaseModelAdmin from sigi.apps.servidores.models import Servidor +from sigi.apps.casas.admin import GerentesInterlegisFilter # class TramitacaoInline(admin.TabularInline): # model = Tramitacao @@ -68,7 +69,9 @@ class ConvenioAdmin(BaseModelAdmin): 'status_convenio', 'link_sigad', 'data_retorno_assinatura', 'duracao', 'projeto', 'status', 'acompanha',) list_display_links = ('num_convenio', 'casa_legislativa',) - list_filter = ('status', ('acompanha', AcompanhaFilter), 'projeto', + list_filter = ('status', ('acompanha', AcompanhaFilter), + ('casa_legislativa__gerentes_interlegis', + GerentesInterlegisFilter), 'projeto', 'casa_legislativa__tipo', 'conveniada','equipada', 'casa_legislativa__municipio__uf',) #date_hierarchy = 'data_adesao' diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 9dcb4b9..843ee3a 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +from datetime import date +from dateutil.relativedelta import relativedelta from django.contrib import admin from django.core.urlresolvers import reverse from django.forms.models import ModelForm @@ -50,6 +52,49 @@ class TipoServicoAdmin(BaseModelAdmin): list_display = ('id', 'sigla', 'nome', 'qtde_casas_atendidas', ) ordering = ['id'] +class DataUtimoUsoFilter(admin.SimpleListFilter): + title = _(u"Atualização") + parameter_name = 'atualizacao' + + def lookups(self, request, model_admin): + return ( + ('err', _(u"Erro na verificação")), + ('year', _(u"Sem atualização há um ano ou mais")), + ('semester', _(u"Sem atualização de seis meses a um ano")), + ('quarter', _(u"Sem atualização de três a seis meses")), + ('month', _(u"Sem atualização de um a três meses")), + ('week', _(u"Sem atualização de uma semana a um mês")), + ('updated', _(u"Atualizado na última semana")), + ) + + def queryset(self, request, queryset): + if self.value() is not None: + queryset = queryset.exclude(tipo_servico__string_pesquisa="") + if self.value() == 'err': + queryset = queryset.exclude(erro_atualizacao="") + elif self.value() == 'year': + limite = date.today() - relativedelta(years=1) + queryset = queryset.filter(data_ultimo_uso__lte=limite) + else: + de = date.today() - ( + relativedelta(months=6) if self.value() == 'semester' else + relativedelta(months=3) if self.value() == 'quarter' else + relativedelta(months=1) if self.value() == 'month' else + relativedelta(days=7) if self.value() == 'week' else + relativedelta(days=0) + ) + ate = date.today() - ( + relativedelta(years=1) if self.value() == 'semester' else + relativedelta(months=6) if self.value() == 'quarter' else + relativedelta(months=3) if self.value() == 'month' else + relativedelta(months=1) if self.value() == 'week' else + relativedelta(days=0) + ) + print (de, ate) + queryset = queryset.filter(data_ultimo_uso__range=(de, ate)) + + return queryset + class ServicoAdmin(BaseModelAdmin): form = ServicoFormAdmin @@ -69,7 +114,7 @@ class ServicoAdmin(BaseModelAdmin): 'fields': ('data_alteracao', 'data_desativacao', 'motivo_desativacao',) })) readonly_fields = ('casa_legislativa', 'data_ativacao', 'data_alteracao') - list_filter = ('tipo_servico', 'hospedagem_interlegis', 'data_ultimo_uso', 'casa_legislativa__municipio__uf', ) + list_filter = ('tipo_servico', 'hospedagem_interlegis', DataUtimoUsoFilter, 'casa_legislativa__municipio__uf', ) list_display_links = [] ordering = ('casa_legislativa__municipio__uf', 'casa_legislativa', 'tipo_servico',) inlines = (LogServicoInline,) @@ -96,7 +141,8 @@ class ServicoAdmin(BaseModelAdmin): url = obj.url if url[-1] != '/': url += '/' - url += obj.tipo_servico.string_pesquisa + if obj.tipo_servico.string_pesquisa: + url += obj.tipo_servico.string_pesquisa.splitlines()[0].split(" ")[0] return u'%s' % (url, obj.erro_atualizacao) get_link_erro.allow_tags = True get_link_erro.short_description = _(u"Erro na atualização") diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index db80fee..0915855 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -76,7 +76,9 @@ class Servidor(models.Model): # Soluçao alternativa para extender o usuário do django # Acessa do servidor de um objeto user criando um profile # baseado nos dados do LDAP -User.servidor = property(lambda user: Servidor.objects.get(user=user)) +User.servidor = property(lambda user: Servidor.objects.get(user=user) + if Servidor.objects.filter(user=user).exists() + else None) # Sinal para ao criar um usuário criar um servidor # baseado no nome contino no LDAP From afdba539f08db02d50039206c7b6632c86b1e6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Mon, 24 May 2021 23:29:17 -0300 Subject: [PATCH 57/69] =?UTF-8?q?Corre=C3=A7=C3=A3o=20filtro=20servi=C3=A7?= =?UTF-8?q?os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/servicos/admin.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 843ee3a..6d77a33 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -from datetime import date -from dateutil.relativedelta import relativedelta +from datetime import date, timedelta from django.contrib import admin from django.core.urlresolvers import reverse from django.forms.models import ModelForm @@ -73,22 +72,22 @@ class DataUtimoUsoFilter(admin.SimpleListFilter): if self.value() == 'err': queryset = queryset.exclude(erro_atualizacao="") elif self.value() == 'year': - limite = date.today() - relativedelta(years=1) + limite = date.today() - timedelta(days=365) queryset = queryset.filter(data_ultimo_uso__lte=limite) else: de = date.today() - ( - relativedelta(months=6) if self.value() == 'semester' else - relativedelta(months=3) if self.value() == 'quarter' else - relativedelta(months=1) if self.value() == 'month' else - relativedelta(days=7) if self.value() == 'week' else - relativedelta(days=0) + timedelta(days=6*30) if self.value() == 'semester' else + timedelta(days=3*30) if self.value() == 'quarter' else + timedelta(days=30) if self.value() == 'month' else + timedelta(days=7) if self.value() == 'week' else + timedelta(days=0) ) ate = date.today() - ( - relativedelta(years=1) if self.value() == 'semester' else - relativedelta(months=6) if self.value() == 'quarter' else - relativedelta(months=3) if self.value() == 'month' else - relativedelta(months=1) if self.value() == 'week' else - relativedelta(days=0) + timedelta(days=365) if self.value() == 'semester' else + timedelta(days=6*30) if self.value() == 'quarter' else + timedelta(days=3*30) if self.value() == 'month' else + timedelta(days=30) if self.value() == 'week' else + timedelta(days=0) ) print (de, ate) queryset = queryset.filter(data_ultimo_uso__range=(de, ate)) From 232357d4d49b90f6b8d02172a6737cbb682bd9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 25 May 2021 09:43:16 -0300 Subject: [PATCH 58/69] =?UTF-8?q?Bug=20no=20filtro=20de=20servi=C3=A7os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/servicos/admin.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 6d77a33..8826b7b 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -7,7 +7,7 @@ from django.http import Http404, HttpResponseRedirect from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ -from sigi.apps.casas.admin import FuncionariosInline +from sigi.apps.casas.admin import FuncionariosInline, GerentesInterlegisFilter from sigi.apps.casas.models import Orgao from sigi.apps.servicos.models import (Servico, LogServico, CasaAtendida, TipoServico) @@ -76,21 +76,21 @@ class DataUtimoUsoFilter(admin.SimpleListFilter): queryset = queryset.filter(data_ultimo_uso__lte=limite) else: de = date.today() - ( - timedelta(days=6*30) if self.value() == 'semester' else - timedelta(days=3*30) if self.value() == 'quarter' else - timedelta(days=30) if self.value() == 'month' else - timedelta(days=7) if self.value() == 'week' else - timedelta(days=0) - ) - ate = date.today() - ( timedelta(days=365) if self.value() == 'semester' else timedelta(days=6*30) if self.value() == 'quarter' else timedelta(days=3*30) if self.value() == 'month' else timedelta(days=30) if self.value() == 'week' else timedelta(days=0) ) - print (de, ate) + ate = date.today() - ( + timedelta(days=6*30) if self.value() == 'semester' else + timedelta(days=3*30) if self.value() == 'quarter' else + timedelta(days=30) if self.value() == 'month' else + timedelta(days=7) if self.value() == 'week' else + timedelta(days=0) + ) queryset = queryset.filter(data_ultimo_uso__range=(de, ate)) + print (de, ate, queryset.count()) return queryset @@ -113,7 +113,13 @@ class ServicoAdmin(BaseModelAdmin): 'fields': ('data_alteracao', 'data_desativacao', 'motivo_desativacao',) })) readonly_fields = ('casa_legislativa', 'data_ativacao', 'data_alteracao') - list_filter = ('tipo_servico', 'hospedagem_interlegis', DataUtimoUsoFilter, 'casa_legislativa__municipio__uf', ) + list_filter = ( + 'tipo_servico', + 'hospedagem_interlegis', + DataUtimoUsoFilter, + ('casa_legislativa__gerentes_interlegis', GerentesInterlegisFilter), + 'casa_legislativa__municipio__uf', + ) list_display_links = [] ordering = ('casa_legislativa__municipio__uf', 'casa_legislativa', 'tipo_servico',) inlines = (LogServicoInline,) From 1085cab91a4978e72f97f984f546b27ca36c4e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 26 May 2021 13:28:24 -0300 Subject: [PATCH 59/69] =?UTF-8?q?Verifica=C3=A7=C3=A3o=20de=20atualiza?= =?UTF-8?q?=C3=A7=C3=A3o=20ignorando=20certificados=20e=20redirects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/servicos/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index af86fc3..ea66ac2 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -149,7 +149,7 @@ class Servico(models.Model): url += param_pesquisa[0] try: # Captura erros de conexão - req = requests.get(url) + req = requests.get(url, verify=False, allow_redirects=True) except Exception as e: return { 'data': '', From a4dc659c82d641071d5f9fe119f9a010264d1aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 27 May 2021 08:36:32 -0300 Subject: [PATCH 60/69] =?UTF-8?q?Ajustes=20sistema=20ocorr=C3=AAncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/ocorrencias/admin.py | 12 ++-- sigi/apps/ocorrencias/filters.py | 5 +- sigi/apps/ocorrencias/models.py | 4 -- .../management/commands/mescla_servidor.py | 68 +++++++++++++++++++ 4 files changed, 79 insertions(+), 10 deletions(-) create mode 100644 sigi/apps/servidores/management/commands/mescla_servidor.py diff --git a/sigi/apps/ocorrencias/admin.py b/sigi/apps/ocorrencias/admin.py index d0159f9..2c55cc9 100644 --- a/sigi/apps/ocorrencias/admin.py +++ b/sigi/apps/ocorrencias/admin.py @@ -3,11 +3,11 @@ from django.contrib import admin from django.contrib.admin.views.main import ChangeList from django.utils.translation import ugettext as _ -from filters import OcorrenciaListFilter +from sigi.apps.ocorrencias.filters import OcorrenciaListFilter from sigi.apps.ocorrencias.models import Ocorrencia, Comentario, Anexo, Categoria, TipoContato from sigi.apps.servidores.models import Servidor from sigi.apps.utils.base_admin import BaseModelAdmin - +from sigi.apps.casas.admin import GerentesInterlegisFilter class ComentarioViewInline(admin.TabularInline): model = Comentario @@ -66,9 +66,11 @@ class OcorrenciaAdmin(BaseModelAdmin): list_display = ('data_criacao', 'casa_legislativa', 'get_municipio', 'get_uf', 'assunto', 'prioridade', 'status', 'data_modificacao', 'setor_responsavel',) - list_filter = (OcorrenciaListFilter, 'status', 'prioridade', - 'categoria__nome', 'setor_responsavel__nome', - 'casa_legislativa__gerentes_interlegis',) + list_filter = ( + OcorrenciaListFilter, 'status', 'prioridade', 'categoria__nome', + 'setor_responsavel__nome', + ('casa_legislativa__gerentes_interlegis', GerentesInterlegisFilter), + ) search_fields = ('casa_legislativa__search_text', 'assunto', 'servidor_registro__nome_completo', 'descricao', 'resolucao', 'ticket',) diff --git a/sigi/apps/ocorrencias/filters.py b/sigi/apps/ocorrencias/filters.py index de4d775..e8b9b80 100644 --- a/sigi/apps/ocorrencias/filters.py +++ b/sigi/apps/ocorrencias/filters.py @@ -11,6 +11,8 @@ class OcorrenciaListFilter(admin.SimpleListFilter): parameter_name = 'minhas' def lookups(self, request, model_admin): + if request.user.servidor is None: + return None return ( ('S', _(u'Atribuídos ao meu setor')), ('M', _(u'Registrados por mim')), @@ -18,7 +20,8 @@ class OcorrenciaListFilter(admin.SimpleListFilter): ) def queryset(self, request, queryset): - servidor = Servidor.objects.get(user=request.user) + servidor = request.user.servidor + # servidor = Servidor.objects.get(user=request.user) if self.value() == 'S': return queryset.filter(setor_responsavel=servidor.servico) elif self.value() == 'M': diff --git a/sigi/apps/ocorrencias/models.py b/sigi/apps/ocorrencias/models.py index 873f731..5e88def 100644 --- a/sigi/apps/ocorrencias/models.py +++ b/sigi/apps/ocorrencias/models.py @@ -60,8 +60,6 @@ class Ocorrencia(models.Model): on_delete=models.CASCADE, verbose_name=_(u'Casa Legislativa') ) - casa_legislativa.convenio_uf_filter = True - casa_legislativa.convenio_cl_tipo_filter = True data_criacao = models.DateField(_(u'Data de criação'), null=True, blank=True, auto_now_add=True) data_modificacao = models.DateField(_(u'Data de modificação'), null=True, blank=True, auto_now=True) categoria = models.ForeignKey( @@ -75,9 +73,7 @@ class Ocorrencia(models.Model): verbose_name=_(u"Tipo de contato") ) assunto = models.CharField(_(u'Assunto'), max_length=200) - assunto.grupo_filter = True status = models.IntegerField(_(u'Status'), choices=STATUS_CHOICES, default=1,) - status.multichoice_filter = True prioridade = models.IntegerField(_(u'Prioridade'), choices=PRIORITY_CHOICES, default=3, ) descricao = models.TextField(_(u'descrição'), blank=True,) resolucao = models.TextField(_(u'resolução'), blank=True,) diff --git a/sigi/apps/servidores/management/commands/mescla_servidor.py b/sigi/apps/servidores/management/commands/mescla_servidor.py new file mode 100644 index 0000000..9f23dfb --- /dev/null +++ b/sigi/apps/servidores/management/commands/mescla_servidor.py @@ -0,0 +1,68 @@ +# coding: utf-8 +from django.contrib.auth.models import User, Group +from sigi.apps.servidores.models import Servidor +from django.core.management.base import BaseCommand + +class Command(BaseCommand): + help = u'Transfere os dados do servidor OLD para o servidor NEW.' + args = u'old_id new_id' + + def handle(self, *args, **options): + if len(args) != 2: + self.stderr.write(u"Informe old_id e new_id") + return + + old_id = args[0] + new_id = args[1] + + old = Servidor.objects.get(id=old_id) + new = Servidor.objects.get(id=new_id) + + self.stdout.write(self.style.WARNING( + u"Transferir dados de {old_name} para {new_name}".format( + old_name=old.nome_completo, + new_name=new.nome_completo + ) + )) + + self.stdout.write(u"\t* Transferindo a carteira de atendimento...") + for casa in old.casas_que_gerencia.all(): + new.casas_que_gerencia.add(casa) + old.casas_que_gerencia.remove(casa) + + self.stdout.write(u"\t* Transferindo ocorrências registradas...") + old.ocorrencia_set.all().update(servidor_registro=new) + + self.stdout.write(u"\t* Transferindo comentários de ocorrências...") + old.comentario_set.all().update(usuario=new) + + self.stdout.write(u"\t* Transferindo convênios geridos...") + old.convenio_set.all().update(servidor_gestao=new) + + self.stdout.write(u"\t* Transferindo convênios acompanhados...") + old.convenio_set.all().update(acompanha=new) + + self.stdout.write(u"\t* Transferindo participação em eventos...") + old.equipe_evento.all().update(membro=new) + + self.stdout.write(u"\t* Transferindo convites para eventos...") + old.convite_set.all().update(servidor=new) + + self.stdout.write(u"\t* Transferindo diagnósticos...") + old.diagnostico_set.all().update(responsavel=new) + + self.stdout.write(u"\t* Transferindo participação em diagnósticos...") + old.equipe_set.all().update(membro=new) + + self.stdout.write(u"\t* Transferindo dados de autenticação...") + + if new.user: + old.user.logentry_set.all().update(user=new) + old.user.delete() + else: + new.user = old.user + new.save() + old.user = None + old.save() + + self.stdout.write(u"Concluído!") \ No newline at end of file From 63fc4b9e315ab55bfc8359184af72b7f54c6af42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 27 May 2021 11:56:08 -0300 Subject: [PATCH 61/69] =?UTF-8?q?Adiciona=20lista=20de=20servidores=20na?= =?UTF-8?q?=20edi=C3=A7=C3=A3o=20do=20servi=C3=A7o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/servidores/admin.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index 7e45acf..7d19536 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -34,12 +34,41 @@ class ServicoInline(admin.TabularInline): model = Servico fields = ['nome', 'sigla', 'responsavel',] +class ServidorInline(admin.TabularInline): + model = Servidor + fields = ('imagem_foto', 'nome_completo', 'is_active', ) + readonly_fields = ('imagem_foto', 'nome_completo', 'is_active', ) + + def has_add_permission(self, request): + return False + + def has_delete_permission(self, request, obj): + return False + + def imagem_foto(sels, servidor): + if servidor.foto: + return u''.format(url=servidor.foto.url) + else: + return u"" + imagem_foto.short_description = _(u"foto") + imagem_foto.allow_tags = True + + def is_active(self, servidor): + if servidor.user: + return servidor.user.is_active + else: + return False + is_active.admin_order_field = 'user__is_active' + is_active.boolean = True + is_active.short_description = _(u'ativo') + + @admin.register(Servico) class ServicoAdmin(admin.ModelAdmin): list_display = ['sigla', 'nome', 'subordinado', 'responsavel'] list_filter = [ServicoFilter,] search_fields = ['nome', 'sigla',] - inlines = [ServicoInline,] + inlines = [ServicoInline, ServidorInline,] @admin.register(Servidor) class ServidorAdmin(BaseModelAdmin): From 1f84e0077addabcc6cd246248a583bf8fd65f388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 2 Jun 2021 00:09:49 -0300 Subject: [PATCH 62/69] Novo mapa usando leaflet e openstreetmap --- sigi/apps/metas/templates/metas/openmap.html | 306 ++++++++++++++++++ .../metas/templates/metas/openmapdetail.html | 23 ++ sigi/apps/metas/urls.py | 5 +- sigi/apps/metas/views.py | 72 ++++- 4 files changed, 401 insertions(+), 5 deletions(-) create mode 100644 sigi/apps/metas/templates/metas/openmap.html create mode 100644 sigi/apps/metas/templates/metas/openmapdetail.html diff --git a/sigi/apps/metas/templates/metas/openmap.html b/sigi/apps/metas/templates/metas/openmap.html new file mode 100644 index 0000000..6f05c56 --- /dev/null +++ b/sigi/apps/metas/templates/metas/openmap.html @@ -0,0 +1,306 @@ +{% load admin_static bootstrapped_goodies_tags %} +{% load i18n %} + + + + {% trans 'SIGI' %} + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        + +
        + +
        +
        +

        Filtros

        + Total de Órgãos selecionados: - +
        + +
        +
        + {% for o in tipos_orgao %} +
        + + +
        + {% endfor %} +
        +
        +
        +
        + +
        +
        +
        + + +
        + {% for s in tipos_servico %} +
        + + +
        + {% endfor %} +
        +
        +
        +
        + +
        +
        +
        + + +
        + {% for c in tipos_convenio %} +
        + + +
        + {% endfor %} +
        +
        +
        +
        + +
        +
        + {% for s, n, ufs in regioes %} +
        + + +
        +
        + {% for uf in ufs %} +
        + + +
        + {% endfor %} +
        + {% endfor %} +
        +
        +
        +
        + +
        +
        +
        + + +
        + {% for g in gerentes %} +
        + + +
        + {% endfor %} +
        +
        +
        + {% comment %}
        +
        +
        +
        +
        {% endcomment %} +
        +
        +
        +
        + +
        + +
        + +
        + + + + diff --git a/sigi/apps/metas/templates/metas/openmapdetail.html b/sigi/apps/metas/templates/metas/openmapdetail.html new file mode 100644 index 0000000..4945662 --- /dev/null +++ b/sigi/apps/metas/templates/metas/openmapdetail.html @@ -0,0 +1,23 @@ +
        +
        + {{ orgao.nome }} +
        +
        + + + {% if orgao.data_instalacao %}{% endif %} + + {% if orgao.telefones.all %}{% endif %} + {% if orgao.email %}{% endif %} + {% if orgao.convenio_set.all %} + + {% endif %} + {% if orgao.servico_set.all %} + + {% endif %} + {% if orgao.gerentes_interlegis.all %} + + {% endif %} +
        CNPJ{{ orgao.cnpj }}
        Data de instalação{{ orgao.data_instalacao }}
        Endereço
        {{ orgao.logradouro }}, {{ orgao.bairro }}, {{ orgao.municipio.nome }}, {{ orgao.municipio.uf.sigla }}, CEP: {{ orgao.cep }}
        Telefones{% for telefone in orgao.telefones.all %}{{ telefone.numero }}{% if not forloop.last %}, {% endif %}{% endfor %}
        E-mail{{ orgao.email }}
        Convênios{% for c in orgao.convenio_set.all %}{{ c }}{% if not forloop.last %}, {% endif %}{% endfor %}
        Serviços{% for s in orgao.servico_set.all %}{% if s.url %}{{ s }}{% else %}{{ s }}{% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}
        Gerentes{% for g in orgao.gerentes_interlegis.all %}{{ g.nome_completo }}{% if not forloop.last %}, {% endif %} {% endfor %}
        +
        +
        \ No newline at end of file diff --git a/sigi/apps/metas/urls.py b/sigi/apps/metas/urls.py index 3d89a57..9f5dcce 100644 --- a/sigi/apps/metas/urls.py +++ b/sigi/apps/metas/urls.py @@ -1,11 +1,14 @@ # coding: utf-8 from django.conf.urls import patterns, url - +from django.views.generic import TemplateView urlpatterns = patterns( 'sigi.apps.metas.views', url(r'^$', 'dashboard', name='metas-dashboardsss'), # tagerror + url(r'^openmap/$', 'openmap', name='openmap'), + url(r'^openmapdata/$', 'openmapdata', name='openmapdata'), + url(r'^openmapdetail/(?P\w+)/$', 'openmapdetail', name='openmapdetail'), url(r'^mapa/$', 'mapa', name='metas-mapa'), # tagerror url(r'^mapdata/$', 'map_data', name='metas-map_data'), url(r'^mapsearch/$', 'map_search', name='metas-map_search'), diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index 0cf636c..58b98a6 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -6,20 +6,21 @@ import time from functools import reduce from django.contrib.auth.decorators import login_required +from django.core import serializers from django.core.exceptions import PermissionDenied from django.db.models import Q from django.db.models.aggregates import Sum -from django.http import HttpResponse -from django.shortcuts import render, render_to_response +from django.http import HttpResponse, JsonResponse +from django.shortcuts import get_object_or_404, render, render_to_response from django.template import RequestContext from django.utils.datastructures import SortedDict from django.utils.translation import ugettext as _ from django.views.decorators.cache import cache_page from easy_thumbnails.templatetags.thumbnail import thumbnail_url -from sigi.apps.casas.models import Orgao +from sigi.apps.casas.models import Orgao, TipoOrgao from sigi.apps.contatos.models import UnidadeFederativa -from sigi.apps.convenios.models import Projeto +from sigi.apps.convenios.models import Convenio, Projeto from sigi.apps.financeiro.models import Desembolso from sigi.apps.servicos.models import TipoServico from sigi.apps.utils import to_ascii @@ -62,6 +63,69 @@ def dashboard(request): extra_context = {'desembolsos': matriz, 'desembolsos_max': desembolsos_max, 'meses': meses, 'colors': ','.join(colors[:len(matriz)])} return render_to_response('metas/dashboard.html', extra_context, context_instance=RequestContext(request)) +def openmap(request): + context = { + 'tipos_orgao': TipoOrgao.objects.filter(legislativo=True), + 'tipos_servico': TipoServico.objects.all(), + 'tipos_convenio': Projeto.objects.all(), + 'gerentes': Servidor.objects.exclude(casas_que_gerencia=None), + 'regioes': [(s, n, UnidadeFederativa.objects.filter(regiao=s)) + for s, n in UnidadeFederativa.REGIAO_CHOICES], + + } + return render(request, 'metas/openmap.html', context) + +def openmapdata(request): + tipos_orgao = request.GET.getlist('tipo_orgao', None) + tipos_servico = request.GET.getlist('tipo_servico', None) + tipos_convenio = request.GET.getlist('tipo_convenio', None) + ufs = request.GET.getlist('uf', None) + gerentes = request.GET.getlist('gerente', None) + reptype = request.GET.get('reptype', None) + + print reptype + print request.GET + + dados = Orgao.objects.all() + + if tipos_orgao: + dados = dados.filter(tipo__sigla__in=tipos_orgao) + else: + dados = dados.filter(tipo__legislativo=True) + + if tipos_servico: + if "none" in tipos_servico: + dados = dados.filter(servico=None) + else: + dados = dados.filter(servico__tipo_servico__sigla__in=tipos_servico) + + if tipos_convenio: + if "none" in tipos_convenio: + dados = dados.filter(convenio=None) + else: + dados = dados.filter(convenio__projeto__sigla__in=tipos_convenio) + + if ufs: + dados = dados.filter(municipio__uf__sigla__in=ufs) + + if gerentes: + if "none" in gerentes: + dados = dados.filter(gerentes_interlegis=None) + else: + dados = dados.filter(gerentes_interlegis__id__in=gerentes) + + dados = dados.distinct("nome") + + if not reptype: + dados = dados.values_list("id", "nome", "municipio__latitude", + "municipio__longitude") + return JsonResponse(list(dados), safe=False) + else: + return JsonResponse({'result': 'todo-feature'}) + +def openmapdetail(request, orgao_id): + orgao = get_object_or_404(Orgao, id=orgao_id) + return render(request, "metas/openmapdetail.html", {'orgao': orgao}) def mapa(request): """ From 52e8931ef952dbd897821f2a093c0b28562c2770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 2 Jun 2021 00:30:14 -0300 Subject: [PATCH 63/69] =?UTF-8?q?Corrige=20formata=C3=A7=C3=A3o=20de=20ids?= =?UTF-8?q?=20no=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/metas/templates/metas/openmap.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigi/apps/metas/templates/metas/openmap.html b/sigi/apps/metas/templates/metas/openmap.html index 6f05c56..e58cb3a 100644 --- a/sigi/apps/metas/templates/metas/openmap.html +++ b/sigi/apps/metas/templates/metas/openmap.html @@ -177,8 +177,8 @@ {% for g in gerentes %}
        - - + +
        {% endfor %} From ad73f26d0fbff7d23327dbe9ce9a2072643d92cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 2 Jun 2021 00:43:20 -0300 Subject: [PATCH 64/69] =?UTF-8?q?Filtrar=20apenas=20servi=C3=A7os=20ativos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/metas/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index 58b98a6..578653d 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -83,9 +83,6 @@ def openmapdata(request): gerentes = request.GET.getlist('gerente', None) reptype = request.GET.get('reptype', None) - print reptype - print request.GET - dados = Orgao.objects.all() if tipos_orgao: @@ -97,7 +94,8 @@ def openmapdata(request): if "none" in tipos_servico: dados = dados.filter(servico=None) else: - dados = dados.filter(servico__tipo_servico__sigla__in=tipos_servico) + dados = dados.filter(servico__tipo_servico__sigla__in=tipos_servico, + servico__data_desativacao=None) if tipos_convenio: if "none" in tipos_convenio: From 91c761081c90dedceba4fbdc6e833a117cfd93ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 8 Jun 2021 13:43:38 -0300 Subject: [PATCH 65/69] =?UTF-8?q?Mapa=20de=20atua=C3=A7=C3=A3o=20do=20Inte?= =?UTF-8?q?rlegis=20repaginado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/models.py | 45 +- .../management/commands/gera_map_data.py | 35 -- sigi/apps/metas/static/metas/css/openmap.css | 58 +++ .../metas/templates/metas/lista_casas.html | 93 ++++ sigi/apps/metas/templates/metas/openmap.html | 129 +++-- sigi/apps/metas/urls.py | 6 +- sigi/apps/metas/views.py | 493 +++++------------- sigiStatic/img/interlegis.png | Bin 0 -> 5257 bytes templates/base_report.html | 32 +- templates/index.html | 2 +- 10 files changed, 408 insertions(+), 485 deletions(-) delete mode 100644 sigi/apps/metas/management/commands/gera_map_data.py create mode 100644 sigi/apps/metas/static/metas/css/openmap.css create mode 100644 sigi/apps/metas/templates/metas/lista_casas.html create mode 100644 sigiStatic/img/interlegis.png diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index b411171..d8534d6 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -241,17 +241,40 @@ class Convenio(models.Model): verbose_name = _(u'convênio') def __unicode__(self): - if self.data_retorno_assinatura is not None: - return _(u"Convênio {project} nº {number} assinado em {date}. Status: {status}".format( - number=self.num_convenio, - project=self.projeto.sigla, - date=self.data_retorno_assinatura, - status=self.get_status())) - else: - return _(u"Adesão ao projeto %(project)s, em %(date)s") % dict( - project=self.projeto.sigla, - date=self.data_adesao) - + # if self.data_retorno_assinatura is not None: + # return _(u"Convênio {project} nº {number} assinado em {date}. Status: {status}".format( + # number=self.num_convenio, + # project=self.projeto.sigla, + # date=self.data_retorno_assinatura, + # status=self.get_status())) + # else: + # return _(u"Adesão ao projeto %(project)s, em %(date)s") % dict( + # project=self.projeto.sigla, + # date=self.data_adesao) + + if ((self.data_retorno_assinatura is None) and + (self.equipada and self.data_termo_aceite is not None)): + return _(u"Equipada em {date} pelo {project}").format( + date=self.data_termo_aceite.strftime('%d/%m/%Y'), + project=self.projeto.sigla) + elif self.data_retorno_assinatura is None: + return _(u"Adesão ao projeto {project}, em {date}").format( + project=self.projeto.sigla, date=self.data_adesao) + if ((self.data_retorno_assinatura is not None) and not + (self.equipada and self.data_termo_aceite is not None)): + return _(u"Conveniada ao {project} em {date}. " + u"Status: {status}").format( + project=self.projeto.sigla, + date=self.data_retorno_assinatura.strftime('%d/%m/%Y'), + status=self.get_status()) + if ((self.data_retorno_assinatura is not None) and + (self.equipada and self.data_termo_aceite is not None)): + return _(u"Conveniada ao {project} em {date} e equipada em " + u"{equipped_date}. Status: {status}").format( + project=self.projeto.sigla, + date=self.data_retorno_assinatura.strftime('%d/%m/%Y'), + equipped_date=self.data_termo_aceite.strftime('%d/%m/%Y'), + status=self.get_status()) class EquipamentoPrevisto(models.Model): diff --git a/sigi/apps/metas/management/commands/gera_map_data.py b/sigi/apps/metas/management/commands/gera_map_data.py deleted file mode 100644 index a5541b2..0000000 --- a/sigi/apps/metas/management/commands/gera_map_data.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# -# sigi.apps.servicos.management.commands.atualiza_uso_servico -# -# Copyright (c) 2012 by Interlegis -# -# GNU General Public License (GPL) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -from django.core.management.base import BaseCommand -from django.utils.translation import ugettext as _ - -from sigi.apps.metas.views import gera_map_data_file - - -class Command(BaseCommand): - help = _(u'Gera arquivo de dados de plotagem do mapa de atuação do Interlegis.') - - def handle(self, *args, **options): - result = gera_map_data_file(cronjob=True) - self.stdout.write(result + "\n") diff --git a/sigi/apps/metas/static/metas/css/openmap.css b/sigi/apps/metas/static/metas/css/openmap.css new file mode 100644 index 0000000..7da5183 --- /dev/null +++ b/sigi/apps/metas/static/metas/css/openmap.css @@ -0,0 +1,58 @@ +body, html, .mapbox, #map { + height: 100%; +} +.filterwrap { + background-color: rgba(255,255,255,0.5); + position: absolute; + top: 0; + left: 0; + z-index: 314159; + height: 100%; + max-height: 100%; + overflow-y: auto; +} +.sigi-logo { + pointer-events: none; + position: absolute; + top: 0; + left: 0; + z-index: 314159; + background-color: transparent; + width: 100%; + text-align: right; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + padding-right: 20px; +} +.sigi-logo h3 { + font-weight: bolder; + margin-bottom: 0px; +} +.sigi-logo a { + pointer-events: auto; +} +.sigi-logo div { + float: right; +} +.sigi-logo img { + margin: 15px; + width: 60px; + height: 60px; +} +.region-ufs { + margin-left: 15px; +} +#search-text { + min-width: 300px; +} +.ui-autocomplete { + max-width: 300px; + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); + box-shadow: 0 1px 2px rgba(0,0,0,.05); + border-color: #ddd; + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + padding: 15px; + font-size: 10px; +} \ No newline at end of file diff --git a/sigi/apps/metas/templates/metas/lista_casas.html b/sigi/apps/metas/templates/metas/lista_casas.html new file mode 100644 index 0000000..98df8c9 --- /dev/null +++ b/sigi/apps/metas/templates/metas/lista_casas.html @@ -0,0 +1,93 @@ +{% extends "base_report.html" %} +{% load mapa_tags %} +{% load i18n %} + +{% block extra_head %} + +{% endblock %} + +{% block pagesize %}A4 landscape{% endblock pagesize %} +{% block title %}{% trans 'Lista de Casas atendidas' %}{% endblock title %} + +{% block report %} +

        {% trans 'Lista de Casas atendidas' %}

        + +{% if tipos_orgao %} + +{% endif %} +{% if tipos_servico %} + +{% endif %} +{% if tipos_convenio %} + +{% endif %} +{% if gerentes %} + +{% endif %} +{% if ufs %} + +{% endif %} +
        {% trans 'Tipos de órgão' %}{% for t in tipos_orgao %}{{ t.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
        {% trans 'Tipos de serviço' %}{% for s in tipos_servico %}{{ s.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
        {% trans 'Tipos de convênio' %}{% for c in tipos_convenio %}{{ c.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
        {% trans 'Gerentes Interlegis' %}{% for g in gerentes %}{{ g.nome_completo }}{% if not forloop.last %}, {% endif %}{% endfor %}
        {% trans 'Estados' %}{% for uf in ufs %}{{ uf.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
        + +
        + + + + + + + + + + {% for casa in casas %} + + + + + + + + + {% endfor %} +
        {% trans 'Casa Legislativa' %}{% trans 'Estado' %}{% trans 'Região' %}{% trans 'Serviços' %}{% trans 'Convênios' %}{% trans 'Gerente(s)' %}
        {{ casa.nome }} {{ casa.municipio.uf.nome }}{{ casa.municipio.uf.get_regiao_display }}
          {% for s in casa.servico_set.all %} + {% if s.data_desativacao == None %} +
        • {{ s }}
        • + {% endif %} + {% endfor %}
          {% for c in casa.convenio_set.all %} +
        • {{ c }}
        • + {% endfor %} +
          {% for g in casa.gerentes_interlegis.all %} +
        • {{ g }}
        • + {% endfor %}
        +
        +{% endblock %} diff --git a/sigi/apps/metas/templates/metas/openmap.html b/sigi/apps/metas/templates/metas/openmap.html index e58cb3a..067cbd1 100644 --- a/sigi/apps/metas/templates/metas/openmap.html +++ b/sigi/apps/metas/templates/metas/openmap.html @@ -8,6 +8,7 @@ + - + - - - - - - + + + + + -
        +
        -
        - +
        + +

        Filtros

        @@ -104,6 +79,10 @@
        +
        + + +
        @@ -125,6 +104,10 @@
        +
        + + +
        @@ -171,6 +154,10 @@
        +
        + + +
        @@ -184,19 +171,17 @@
        - {% comment %}
        +
        -
        -
        {% endcomment %} +
        -
        @@ -204,6 +189,43 @@