Browse Source

Atualiza para Django 1.9.6

atualiza-django-1.10.5
Sesostris Vieira 9 years ago
committed by Luciano Almeida
parent
commit
690c098b2e
  1. 8
      requirements/dev-requirements.txt
  2. 26
      requirements/requirements.txt
  3. 16
      requirements/test-requirements.txt
  4. 4
      sigi/apps/casas/admin.py
  5. 8
      sigi/apps/casas/models.py
  6. 10
      sigi/apps/contatos/models.py
  7. 8
      sigi/apps/convenios/models.py
  8. 2
      sigi/apps/diagnosticos/forms.py
  9. 4
      sigi/apps/diagnosticos/models.py
  10. 2
      sigi/apps/diagnosticos/templates/diagnosticos/mapa.html
  11. 6
      sigi/apps/diagnosticos/widgets.py
  12. 6
      sigi/apps/inventario/admin.py
  13. 6
      sigi/apps/inventario/models.py
  14. 2
      sigi/apps/metas/templates/metas/mapa.html
  15. 12
      sigi/apps/metas/views.py
  16. 4
      sigi/apps/ocorrencias/forms.py
  17. 2
      sigi/apps/ocorrencias/models.py
  18. 2
      sigi/apps/ocorrencias/templates/ocorrencias/painel.html
  19. 4
      sigi/apps/parlamentares/admin.py
  20. 4
      sigi/apps/servicos/admin.py
  21. 2
      sigi/apps/servicos/models.py
  22. 2
      sigi/apps/servicos/templates/servicos/mapa.html
  23. 2
      sigi/apps/servidores/admin.py
  24. 6
      sigi/apps/servidores/models.py
  25. 4
      sigi/settings/base.py
  26. 4
      templates/index.html

8
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

26
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

16
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

4
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

8
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")

10
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')

8
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,
)

2
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)

4
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)

2
sigi/apps/diagnosticos/templates/diagnosticos/mapa.html

@ -6,7 +6,7 @@
{{ block.super }}
{% load static from staticfiles %}
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery-1.9.1.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"> </script>
<script type="text/javascript">

6
sigi/apps/diagnosticos/widgets.py

@ -1,5 +1,5 @@
from itertools import chain
from django.forms.widgets import CheckboxInput, CheckboxSelectMultiple, RadioSelect, RadioFieldRenderer, RadioInput
from django.forms.widgets import CheckboxInput, CheckboxSelectMultiple, RadioSelect, RadioFieldRenderer, RadioChoiceInput
from django.utils.html import conditional_escape
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
@ -46,7 +46,7 @@ class EavRadioFieldRenderer(RadioFieldRenderer):
if schema_to_open:
final_attrs['schema_to_open'] = schema_to_open.name
yield RadioInput(self.name, self.value, final_attrs, choice, i)
yield RadioChoiceInput(self.name, self.value, final_attrs, choice, i)
def __getitem__(self, idx):
choice = self.choices[idx]
@ -59,7 +59,7 @@ class EavRadioFieldRenderer(RadioFieldRenderer):
if schema_to_open:
final_attrs['schema_to_open'] = schema_to_open.name
return RadioInput(self.name, self.value, final_attrs, choice, idx)
return RadioChoiceInput(self.name, self.value, final_attrs, choice, idx)
class EavRadioSelect(RadioSelect):

6
sigi/apps/inventario/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 sigi.apps.contatos.models import Contato, Telefone
from sigi.apps.inventario.models import (Fornecedor, Fabricante, Equipamento,
@ -9,13 +9,13 @@ from sigi.apps.inventario.models import (Fornecedor, Fabricante, Equipamento,
from sigi.apps.utils.base_admin import BaseModelAdmin
class ContatosInline(generic.GenericTabularInline):
class ContatosInline(GenericTabularInline):
model = Contato
extra = 2
raw_id_fields = ('municipio',)
class TelefonesInline(generic.GenericTabularInline):
class TelefonesInline(GenericTabularInline):
model = Telefone
extra = 2

6
sigi/apps/inventario/models.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from django.contrib.contenttypes import generic
from django.contrib.contenttypes import fields
from django.db import models
from django.utils.translation import ugettext as _
@ -9,8 +9,8 @@ class Fornecedor(models.Model):
nome.alphabetic_filter = True
email = models.EmailField(_(u'e-mail'), blank=True)
pagina_web = models.URLField(_(u'página web'), blank=True)
telefones = generic.GenericRelation('contatos.Telefone')
contatos = generic.GenericRelation('contatos.Contato')
telefones = fields.GenericRelation('contatos.Telefone')
contatos = fields.GenericRelation('contatos.Contato')
class Meta:
ordering = ('nome',)

2
sigi/apps/metas/templates/metas/mapa.html

@ -8,7 +8,7 @@
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery-1.9.1.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="{% static 'metas/js/mapa.js' %}" ></script>

12
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

4
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}), }
widgets = {'casa_legislativa': AjaxSelect(url=reverse_lazy('painel-buscacasa'), attrs={'size':100}), }

2
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:

2
sigi/apps/ocorrencias/templates/ocorrencias/painel.html

@ -11,7 +11,7 @@
{% block extrahead %}
{{ block.super }}
<script type="text/javascript" src="{% static 'admin/js/core.js' %}" ></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.min.js' %}" ></script>
<script type="text/javascript" src="{% static 'admin/js/jquery-1.9.1.min.js' %}" ></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}" ></script>
<script type="text/javascript" src="{% static 'ocorrencias/js/jquery-ui.min.js' %}" ></script>
{% endblock %}

4
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

4
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):

2
sigi/apps/servicos/models.py

@ -15,7 +15,7 @@ class TipoServico(models.Model):
{url} para incluir a URL do serviço,<br/>
{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'))

2
sigi/apps/servicos/templates/servicos/mapa.html

@ -7,7 +7,7 @@
{{ block.super }}
{% load static from staticfiles %}
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery-1.9.1.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"> </script>
<script type="text/javascript">

2
sigi/apps/servidores/admin.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.contenttypes import generic
from django.contrib.contenttypes import admin as generic
from django.utils.translation import ugettext as _
from sigi.apps.contatos.models import Endereco, Telefone

6
sigi/apps/servidores/models.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes import fields
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import ugettext as _
@ -105,8 +105,8 @@ class Servidor(models.Model):
# Informações de contato
email_pessoal = models.EmailField('email pessoal', blank=True, null=True)
endereco = generic.GenericRelation('contatos.Endereco')
telefones = generic.GenericRelation('contatos.Telefone')
endereco = fields.GenericRelation('contatos.Endereco')
telefones = fields.GenericRelation('contatos.Telefone')
ramal = models.CharField(max_length=25, blank=True, null=True)
class Meta:

4
sigi/settings/base.py

@ -30,9 +30,9 @@ MANAGERS = ADMINS
SITE_ID = 1
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + [
'django.core.context_processors.request',
)
]
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',

4
templates/index.html

@ -9,7 +9,7 @@
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}" >
<script type="text/javascript" src="{% static 'admin/js/core.js' %}" ></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.min.js' %}" ></script>
<script type="text/javascript" src="{% static 'admin/js/jquery-1.9.1.min.js' %}" ></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}" ></script>
<script type="text/javascript" src="{% static 'js/Chart.min.js' %}" ></script>
<script type="text/javascript" src="{% static 'js/dashboard.js' %}"></script>
@ -33,4 +33,4 @@
<div id="content-main">
{% include "snippets/modules/charts-convenios.html" %}
</div>
{% endblock %}
{% endblock %}

Loading…
Cancel
Save