diff --git a/requirements/dev-requirements.txt b/requirements/dev-requirements.txt index 547f372..1a43776 100644 --- a/requirements/dev-requirements.txt +++ b/requirements/dev-requirements.txt @@ -1,5 +1,5 @@ -r test-requirements.txt -django-debug-toolbar==1.2.2 -ipdb==0.8 -ipython==2.3.1 -pygraphviz==1.2 +django-debug-toolbar==1.4 +ipdb==0.10.0 +ipython==4.2.0 +pygraphviz==1.3.1 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index abfd1d4..570c578 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,23 +1,23 @@ -e git://github.com/marinho/geraldo.git@868ebdce67176d9b6205cddc92476f642c783fff#egg=geraldo -django-bootstrap3==6.2.2 -django-admin-bootstrapped==2.4.0 -django-auth-ldap==1.2.7 +django-bootstrap3==7.0.1 +django-admin-bootstrapped==2.5.7 +django-auth-ldap==1.2.8 django-autoslug==1.9.3 -django-extensions==1.5.7 -django-image-cropping==1.0.2 -django-localflavor==1.1 -Django==1.7.10 -easy-thumbnails==2.2 +django-extensions==1.6.7 +django-image-cropping==1.0.3 +django-localflavor==1.3 +Django==1.9.6 +easy-thumbnails==2.3 eav-django==1.4.7 -gunicorn==19.3.0 +gunicorn==19.6.0 html5lib==0.9999999 -Pillow==2.9.0 +Pillow==3.2.0 pisa==3.0.33 psycopg2==2.6.1 -python-memcached==1.53 +python-memcached==1.58 PyYAML==3.11 -reportlab==2.7 -requests==2.8.1 +reportlab==3.3.0 +requests==2.10.0 six==1.10.0 djangorestframework==2.4.8 django-ipware==1.1.6 diff --git a/requirements/test-requirements.txt b/requirements/test-requirements.txt index 6a2cb2f..e3bbda1 100644 --- a/requirements/test-requirements.txt +++ b/requirements/test-requirements.txt @@ -1,10 +1,10 @@ -r requirements.txt -coverage==3.7.1 -django-dynamic-fixture==1.8.1 -django-webtest==1.7.7 +coverage==4.1 +django-dynamic-fixture==1.9.0 +django-webtest==1.7.9 pyPdf==1.13 -pyquery==1.2.9 -pytest-cov==1.8.1 -pytest-django==2.8.0 -pytest==2.6.4 -WebTest==2.0.17 +pyquery==1.2.13 +pytest-cov==2.2.1 +pytest-django==2.9.1 +pytest==2.9.2 +WebTest==2.0.21 diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 392d752..8f6b0b0 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.core.urlresolvers import reverse from django.contrib import admin -from django.contrib.contenttypes import generic +from django.contrib.contenttypes.admin import GenericTabularInline from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from image_cropping import ImageCroppingMixin @@ -24,7 +24,7 @@ from sigi.apps.utils import queryset_ascii from sigi.apps.utils.base_admin import BaseModelAdmin -class TelefonesInline(generic.GenericTabularInline): +class TelefonesInline(GenericTabularInline): model = Telefone readonly_fields = ('ult_alteracao',) extra = 1 diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index b199579..deb5955 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -4,7 +4,7 @@ from string import ascii_uppercase from unicodedata import normalize from datetime import datetime -from django.contrib.contenttypes import generic +from django.contrib.contenttypes import fields from django.db import models from image_cropping import ImageRatioField @@ -85,7 +85,7 @@ class CasaLegislativa(models.Model): 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') + telefones = fields.GenericRelation('contatos.Telefone') foto = models.ImageField( upload_to='imagens/casas', @@ -293,8 +293,8 @@ class Funcionario(models.Model): sexo = models.CharField(max_length=1, choices=SEXO_CHOICES, default="M") 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') - endereco = generic.GenericRelation('contatos.Endereco') + telefones = fields.GenericRelation('contatos.Telefone') + endereco = fields.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") diff --git a/sigi/apps/contatos/models.py b/sigi/apps/contatos/models.py index 9b3becf..04cd2ae 100644 --- a/sigi/apps/contatos/models.py +++ b/sigi/apps/contatos/models.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from django.contrib.contenttypes import generic +from django.contrib.contenttypes import fields from django.contrib.contenttypes.models import ContentType from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models @@ -176,7 +176,7 @@ class Telefone(models.Model): content_type = models.ForeignKey(ContentType) # identificador do registro na classe vinculado a esse registro object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = fields.GenericForeignKey('content_type', 'object_id') class Meta: ordering = ('numero',) @@ -196,7 +196,7 @@ class Contato(models.Model): nota = models.CharField(max_length=70, blank=True) email = models.EmailField(_(u'e-mail'), blank=True) - telefones = generic.GenericRelation(Telefone) + telefones = fields.GenericRelation(Telefone) municipio = models.ForeignKey( Municipio, @@ -209,7 +209,7 @@ class Contato(models.Model): content_type = models.ForeignKey(ContentType) # identificador do registro na classe vinculado a esse registro object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = fields.GenericForeignKey('content_type', 'object_id') class Meta: ordering = ('nome',) @@ -301,7 +301,7 @@ class Endereco(models.Model): content_type = models.ForeignKey(ContentType) # identificador do registro na classe vinculado a esse registro object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = fields.GenericForeignKey('content_type', 'object_id') class Meta: ordering = ('logradouro', 'numero') diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 07ddcd3..7bf0f92 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -148,7 +148,7 @@ class Anexo(models.Model): convenio = models.ForeignKey(Convenio, 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') + descricao = models.CharField(_(u'descrição'), max_length=70) data_pub = models.DateTimeField( _(u'data da publicação do anexo'), default=datetime.now @@ -167,8 +167,8 @@ class UnidadeAdministrativa(models.Model): que pode ser um servivo do próprio Interlegis, assim como uma unidade do Senado Federal """ - sigla = models.CharField(max_length='10') - nome = models.CharField(max_length='100') + sigla = models.CharField(max_length=10) + nome = models.CharField(max_length=100) def __unicode__(self): return unicode(self.sigla) @@ -184,7 +184,7 @@ class Tramitacao(models.Model): data = models.DateField() observacao = models.CharField( _(u'observação'), - max_length='512', + max_length=512, null=True, blank=True, ) diff --git a/sigi/apps/diagnosticos/forms.py b/sigi/apps/diagnosticos/forms.py index a271a1f..e381ccc 100644 --- a/sigi/apps/diagnosticos/forms.py +++ b/sigi/apps/diagnosticos/forms.py @@ -2,7 +2,7 @@ from copy import deepcopy from django import forms -from django.contrib.contenttypes.generic import generic_inlineformset_factory +from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.forms import (BooleanField, CharField, DateField, FloatField, ModelChoiceField, Textarea, ModelMultipleChoiceField) diff --git a/sigi/apps/diagnosticos/models.py b/sigi/apps/diagnosticos/models.py index 1b71459..45030e2 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='schema_to_open_related', verbose_name=_(u'pergunta para abrir'), blank=True, null=True) ordem = models.PositiveIntegerField(blank=True, null=True) @@ -242,7 +242,7 @@ class Anexo(models.Model): """ diagnostico = models.ForeignKey(Diagnostico, 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') + descricao = models.CharField(_(u'descrição'), max_length=70) data_pub = models.DateTimeField(_(u'data da publicação do anexo'), default=datetime.now) diff --git a/sigi/apps/diagnosticos/templates/diagnosticos/mapa.html b/sigi/apps/diagnosticos/templates/diagnosticos/mapa.html index 072201c..16fe77f 100644 --- a/sigi/apps/diagnosticos/templates/diagnosticos/mapa.html +++ b/sigi/apps/diagnosticos/templates/diagnosticos/mapa.html @@ -6,7 +6,7 @@ {{ block.super }} {% load static from staticfiles %} - + - + diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index b72b3cb..a1f086d 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -12,7 +12,7 @@ from django.db.models.aggregates import Sum from django.http import HttpResponse from django.shortcuts import render, render_to_response from django.template import RequestContext -from django.utils.datastructures import SortedDict +from collections import OrderedDict from django.utils.translation import ugettext as _ from django.views.decorators.cache import cache_page from easy_thumbnails.templatetags.thumbnail import thumbnail_url @@ -36,8 +36,8 @@ def dashboard(request): raise PermissionDenied desembolsos_max = 0 - matriz = SortedDict() - dados = SortedDict() + matriz = OrderedDict() + dados = OrderedDict() projetos = Projeto.objects.all() meses = Desembolso.objects.dates('data', 'month', 'DESC')[:6] colors = ['ffff00', 'cc7900', 'ff0000', '92d050', '006600', '0097cc', '002776', 'ae78d6', 'ff00ff', '430080', @@ -137,9 +137,9 @@ def map_sum(request): casas = filtrar_casas(**param) # Montar registros de totalização - tot_servicos = SortedDict() - tot_projetos = SortedDict() - tot_diagnosticos = SortedDict() + tot_servicos = OrderedDict() + tot_projetos = OrderedDict() + tot_diagnosticos = OrderedDict() for ts in TipoServico.objects.all(): tot_servicos[ts.sigla] = 0 diff --git a/sigi/apps/ocorrencias/forms.py b/sigi/apps/ocorrencias/forms.py index bc37fea..45e01d9 100644 --- a/sigi/apps/ocorrencias/forms.py +++ b/sigi/apps/ocorrencias/forms.py @@ -68,7 +68,7 @@ class AnexoForm(ModelForm): widgets = {'ocorrencia': HiddenInput()} class ComentarioForm(ModelForm): - encaminhar_setor = ModelChoiceField(queryset=Servico.objects.all(), cache_choices=True) + encaminhar_setor = ModelChoiceField(queryset=Servico.objects.all()) class Meta: model = Comentario @@ -80,4 +80,4 @@ class OcorrenciaForm(ModelForm): model = Ocorrencia fields = ['casa_legislativa', 'categoria', 'tipo_contato', 'assunto', 'prioridade', 'ticket', 'descricao', 'setor_responsavel',] - widgets = {'casa_legislativa': AjaxSelect(url=reverse_lazy('painel-buscacasa'), attrs={'size':100}), } \ No newline at end of file + widgets = {'casa_legislativa': AjaxSelect(url=reverse_lazy('painel-buscacasa'), attrs={'size':100}), } diff --git a/sigi/apps/ocorrencias/models.py b/sigi/apps/ocorrencias/models.py index 2bfe120..125bd1c 100644 --- a/sigi/apps/ocorrencias/models.py +++ b/sigi/apps/ocorrencias/models.py @@ -105,7 +105,7 @@ class Comentario(models.Model): class Anexo(models.Model): ocorrencia = models.ForeignKey(Ocorrencia, 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') + 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) class Meta: diff --git a/sigi/apps/ocorrencias/templates/ocorrencias/painel.html b/sigi/apps/ocorrencias/templates/ocorrencias/painel.html index 4e964bf..7939170 100644 --- a/sigi/apps/ocorrencias/templates/ocorrencias/painel.html +++ b/sigi/apps/ocorrencias/templates/ocorrencias/painel.html @@ -11,7 +11,7 @@ {% block extrahead %} {{ block.super }} - + {% endblock %} diff --git a/sigi/apps/parlamentares/admin.py b/sigi/apps/parlamentares/admin.py index 80c8ebc..e42e8c3 100644 --- a/sigi/apps/parlamentares/admin.py +++ b/sigi/apps/parlamentares/admin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.contrib import admin -from django.contrib.contenttypes import generic +from django.contrib.contenttypes.admin import GenericTabularInline from django.http import HttpResponseRedirect, HttpResponse from django.utils.html import escape, escapejs from django.utils.translation import ugettext as _ @@ -20,7 +20,7 @@ class MandatosInline(admin.TabularInline): raw_id_fields = ('legislatura', 'partido') -class TelefonesInline(generic.GenericTabularInline): +class TelefonesInline(GenericTabularInline): model = Telefone extra = 2 diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index cecc0a8..7e7da33 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -109,11 +109,11 @@ class ServicoAdmin(BaseModelAdmin): calcular_data_uso.short_description = _(u"Atualizar a data do último uso do(s) serviço(s)") def get_actions(self, request): - from django.utils.datastructures import SortedDict + from collections import OrderedDict actions = [self.get_action(action) for action in self.actions] actions = filter(None, actions) actions.sort(lambda a, b: cmp(a[2].lower(), b[2].lower())) - actions = SortedDict([(name, (func, name, desc)) for func, name, desc in actions]) + actions = OrderedDict([(name, (func, name, desc)) for func, name, desc in actions]) return actions def lookup_allowed(self, lookup, value): diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index 6a9cde7..107bf1b 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -15,7 +15,7 @@ class TipoServico(models.Model): {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') + 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')) diff --git a/sigi/apps/servicos/templates/servicos/mapa.html b/sigi/apps/servicos/templates/servicos/mapa.html index 9450867..1502563 100644 --- a/sigi/apps/servicos/templates/servicos/mapa.html +++ b/sigi/apps/servicos/templates/servicos/mapa.html @@ -7,7 +7,7 @@ {{ block.super }} {% load static from staticfiles %} - + - + @@ -33,4 +33,4 @@
{% include "snippets/modules/charts-convenios.html" %}
-{% endblock %} \ No newline at end of file +{% endblock %}