diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 3685f93..0532d52 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -6,7 +6,7 @@ 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 django.utils.translation import gettext as _ #from geraldo.site.newsite.django_1_0.django.forms import extras from image_cropping import ImageCroppingMixin @@ -85,7 +85,7 @@ class FuncionariosInline(admin.StackedInline): 'endereco', 'municipio', 'bairro', 'cep', 'redes_sociais', 'desativado', 'observacoes') raw_id_fields = ('municipio',) - + # fieldsets = ((None, { # 'fields': ( # ('nome', 'sexo', 'data_nascimento'), @@ -336,7 +336,7 @@ class ExcluirConvenioFilter(admin.SimpleListFilter): def queryset(self, request, queryset): if (self.value() is None): return queryset - else: + else: queryset = queryset.exclude(convenio__projeto_id=self.value()).distinct('municipio__uf__nome', 'nome') return queryset diff --git a/sigi/apps/casas/forms.py b/sigi/apps/casas/forms.py index a8396c4..3e9030a 100644 --- a/sigi/apps/casas/forms.py +++ b/sigi/apps/casas/forms.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from localflavor.br.forms import BRZipCodeField from sigi.apps.casas.models import Orgao diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index f1554a9..876308e 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -4,7 +4,7 @@ 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.utils.translation import gettext as _ from django.contrib.contenttypes.fields import GenericRelation from django.db import models from image_cropping import ImageRatioField diff --git a/sigi/apps/casas/reports.py b/sigi/apps/casas/reports.py index c2a380a..547ea0c 100644 --- a/sigi/apps/casas/reports.py +++ b/sigi/apps/casas/reports.py @@ -3,7 +3,7 @@ from geraldo import Report, DetailBand, Label, ObjectValue, ReportGroup, ReportB from geraldo.graphics import Image from django.templatetags.static import static -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from reportlab.lib.enums import TA_CENTER from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm diff --git a/sigi/apps/casas/views.py b/sigi/apps/casas/views.py index 741786d..6aa6781 100644 --- a/sigi/apps/casas/views.py +++ b/sigi/apps/casas/views.py @@ -13,7 +13,7 @@ from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.db.models import Count, Q 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.utils.translation import gettext as _, ungettext from django.views.generic import View from sigi.apps.casas.forms import PortfolioForm, AtualizaCasaForm diff --git a/sigi/apps/contatos/admin.py b/sigi/apps/contatos/admin.py index 768956f..3ea4baf 100644 --- a/sigi/apps/contatos/admin.py +++ b/sigi/apps/contatos/admin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.contrib import admin -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.contatos.filters import PopulationFilter from sigi.apps.contatos.models import (UnidadeFederativa, Mesorregiao, Microrregiao, @@ -10,10 +10,10 @@ from sigi.apps.utils.base_admin import BaseModelAdmin class MesorregiaoInline(admin.TabularInline): model = Mesorregiao - + class MicrorregiaoInline(admin.TabularInline): model = Microrregiao - + class UnidadeFederativaAdmin(BaseModelAdmin): actions = None list_display = ('codigo_ibge', 'nome', 'sigla', 'regiao', 'populacao') @@ -22,7 +22,7 @@ class UnidadeFederativaAdmin(BaseModelAdmin): search_fields = ('search_text', 'codigo_ibge', 'sigla', 'regiao') get_queryset = queryset_ascii inlines = (MesorregiaoInline, ) - + class MesorregiaoAdmin(BaseModelAdmin): actions = None list_display = ('codigo_ibge', 'uf', 'nome') diff --git a/sigi/apps/contatos/filters.py b/sigi/apps/contatos/filters.py index 7da9cfb..ec15bfb 100644 --- a/sigi/apps/contatos/filters.py +++ b/sigi/apps/contatos/filters.py @@ -1,6 +1,6 @@ # coding: utf-8 from django.contrib import admin -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class PopulationFilter(admin.SimpleListFilter): diff --git a/sigi/apps/contatos/models.py b/sigi/apps/contatos/models.py index 79bf0ca..65b1d44 100644 --- a/sigi/apps/contatos/models.py +++ b/sigi/apps/contatos/models.py @@ -4,7 +4,7 @@ from django.contrib.contenttypes.fields import (GenericForeignKey, from django.contrib.contenttypes.models import ContentType from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.utils import SearchField diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 971dd1e..38b0a51 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.contrib import admin from django.http import HttpResponse, HttpResponseRedirect -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from geraldo.generators import PDFGenerator from sigi.apps.convenios.models import (Projeto, StatusConvenio, diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 7e69675..460016d 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -6,7 +6,7 @@ from django.db import models from django.db.models import Q, fields from django.core.mail import send_mail from django.core.urlresolvers import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.utils import SearchField, to_ascii from sigi.apps.casas.models import Orgao from sigi.apps.servidores.models import Servidor, Servico diff --git a/sigi/apps/convenios/reports.py b/sigi/apps/convenios/reports.py index dea94fc..2f5454c 100644 --- a/sigi/apps/convenios/reports.py +++ b/sigi/apps/convenios/reports.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from geraldo import ReportBand, ObjectValue, Label, ReportGroup, FIELD_ACTION_SUM from reportlab.lib.units import cm @@ -27,7 +27,7 @@ class SemEquipamentosReport(object): class ConvenioReport(ReportDefault): title = _(u'Relatório de Parcerias') - + class band_page_header(ReportDefault.band_page_header): label_top = ReportDefault.band_page_header.label_top @@ -160,7 +160,7 @@ class ConvenioReportSemAceite(ConvenioReport): left=label_left[2] * cm, top=label_top, width=2 * cm, - ), + ), Label( text=_(u"Projeto"), left=label_left[3] * cm, diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index e829d09..d08d46a 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -10,7 +10,7 @@ from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, get_list_or_404 from django.template import Context, loader -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from geraldo.generators import PDFGenerator from sigi.apps.casas.models import Orgao diff --git a/sigi/apps/diagnosticos/admin.py b/sigi/apps/diagnosticos/admin.py index 402e7da..d8e4893 100644 --- a/sigi/apps/diagnosticos/admin.py +++ b/sigi/apps/diagnosticos/admin.py @@ -2,7 +2,7 @@ from datetime import datetime from django.contrib import admin from django.db.utils import OperationalError, ProgrammingError -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from eav.admin import BaseEntityAdmin, BaseSchemaAdmin from sigi.apps.diagnosticos.forms import DiagnosticoForm diff --git a/sigi/apps/diagnosticos/forms.py b/sigi/apps/diagnosticos/forms.py index 5ff92d5..8668e26 100644 --- a/sigi/apps/diagnosticos/forms.py +++ b/sigi/apps/diagnosticos/forms.py @@ -7,7 +7,7 @@ from django.forms import (BooleanField, CharField, DateField, FloatField, ModelChoiceField, Textarea, ModelMultipleChoiceField) from django.forms.forms import BoundField -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from eav.fields import RangeField from eav.forms import BaseDynamicEntityForm diff --git a/sigi/apps/diagnosticos/models.py b/sigi/apps/diagnosticos/models.py index 44fc90c..1b540a2 100644 --- a/sigi/apps/diagnosticos/models.py +++ b/sigi/apps/diagnosticos/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from datetime import datetime from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from eav.models import BaseChoice, BaseEntity, BaseSchema, BaseAttribute from sigi.apps.utils import SearchField diff --git a/sigi/apps/diagnosticos/views.py b/sigi/apps/diagnosticos/views.py index 2b4dfba..e51a884 100644 --- a/sigi/apps/diagnosticos/views.py +++ b/sigi/apps/diagnosticos/views.py @@ -5,7 +5,7 @@ from itertools import cycle from django.http import HttpResponse from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.decorators.cache import never_cache from sigi.apps.casas.models import Funcionario diff --git a/sigi/apps/eventos/admin.py b/sigi/apps/eventos/admin.py index 198ef32..dfd167c 100644 --- a/sigi/apps/eventos/admin.py +++ b/sigi/apps/eventos/admin.py @@ -22,7 +22,7 @@ from django import forms from django.contrib import admin from django.db import models from django.http import HttpResponseRedirect -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.eventos.models import (ModeloDeclaracao, Modulo, TipoEvento, Funcao, Evento, Equipe, Convite, Anexo) from sigi.apps.eventos.views import adicionar_eventos_carrinho diff --git a/sigi/apps/eventos/forms.py b/sigi/apps/eventos/forms.py index 7ec8869..3ebf6e6 100644 --- a/sigi/apps/eventos/forms.py +++ b/sigi/apps/eventos/forms.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.eventos.models import ModeloDeclaracao, Evento class EventoAdminForm(forms.ModelForm): diff --git a/sigi/apps/eventos/models.py b/sigi/apps/eventos/models.py index 041fb0e..087b35a 100644 --- a/sigi/apps/eventos/models.py +++ b/sigi/apps/eventos/models.py @@ -4,7 +4,7 @@ import random from django.db import models from django.db.models import Sum from django.utils.functional import lazy -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.contrib.contenttypes import generic from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import Municipio diff --git a/sigi/apps/eventos/views.py b/sigi/apps/eventos/views.py index fb3ebc1..578fc8a 100644 --- a/sigi/apps/eventos/views.py +++ b/sigi/apps/eventos/views.py @@ -29,7 +29,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404, render from django.utils import translation -from django.utils.translation import ungettext, ugettext as _ +from django.utils.translation import ungettext, gettext as _ from django.http.response import JsonResponse, HttpResponse from django.template import Template, Context from sigi.apps.eventos.models import Evento, Equipe, Convite, Modulo @@ -300,13 +300,13 @@ def deleta_itens_carrinho(request): @login_required def export_csv(request): - def rm_rows(lista,reg): - for a in lista: + def rm_rows(lista,reg): + for a in lista: if a in lista: reg.pop(a,None) - else: + else: pass - + def serialize(r, field): value = (getattr(r, 'get_{0}_display'.format(field.name), None) or getattr(r, field.name, "")) @@ -343,15 +343,15 @@ def export_csv(request): response['Content-Disposition'] = 'attachment; filename=eventos.csv' rm_list = ['Descrição do evento', 'Local do evento', 'Público alvo', 'Motivo do cancelamento', 'Descrição do módulo'] - for a in head: - if 'Observações_' in a: + for a in head: + if 'Observações_' in a: rm_list.append(a) - - for a in rm_list: - if a in head: + + for a in rm_list: + if a in head: head.remove(a) - else: - pass + else: + pass writer = csv.DictWriter(response, fieldnames=head) writer.writeheader() @@ -387,12 +387,12 @@ def export_csv(request): ) rm_rows(rm_list,reg) writer.writerow(reg) - + if evento.convite_set.count() == 0: rm_rows(rm_list,reg) writer.writerow(reg) - + return response @login_required diff --git a/sigi/apps/financeiro/models.py b/sigi/apps/financeiro/models.py index e0e2061..73b5023 100644 --- a/sigi/apps/financeiro/models.py +++ b/sigi/apps/financeiro/models.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.convenios.models import Projeto diff --git a/sigi/apps/home/views.py b/sigi/apps/home/views.py index 1f6543b..7952b44 100644 --- a/sigi/apps/home/views.py +++ b/sigi/apps/home/views.py @@ -25,7 +25,7 @@ import datetime import calendar from django.shortcuts import render, get_object_or_404 -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from itertools import cycle from sigi.apps.casas.models import Orgao from sigi.apps.convenios.models import Convenio, Projeto diff --git a/sigi/apps/inventario/models.py b/sigi/apps/inventario/models.py index 10a6bd2..07da98b 100644 --- a/sigi/apps/inventario/models.py +++ b/sigi/apps/inventario/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.contrib.contenttypes.fields import GenericRelation from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class Fornecedor(models.Model): diff --git a/sigi/apps/metas/admin.py b/sigi/apps/metas/admin.py index 37c0941..fc716ed 100644 --- a/sigi/apps/metas/admin.py +++ b/sigi/apps/metas/admin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.contrib import admin -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.metas.models import PlanoDiretor from sigi.apps.utils.base_admin import BaseModelAdmin diff --git a/sigi/apps/metas/models.py b/sigi/apps/metas/models.py index c267abf..4b192ac 100644 --- a/sigi/apps/metas/models.py +++ b/sigi/apps/metas/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from datetime import date from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.casas.models import Orgao from sigi.apps.convenios.models import Projeto, Convenio diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index 59b22f3..274e6fa 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -15,7 +15,7 @@ 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.utils.translation import gettext as _ from django.views.decorators.cache import cache_page from easy_thumbnails.templatetags.thumbnail import thumbnail_url diff --git a/sigi/apps/ocorrencias/admin.py b/sigi/apps/ocorrencias/admin.py index 4f873b87..7840cc8 100644 --- a/sigi/apps/ocorrencias/admin.py +++ b/sigi/apps/ocorrencias/admin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.admin.views.main import ChangeList -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.ocorrencias.filters import OcorrenciaListFilter from sigi.apps.ocorrencias.models import Ocorrencia, Comentario, Anexo, Categoria, TipoContato diff --git a/sigi/apps/ocorrencias/filters.py b/sigi/apps/ocorrencias/filters.py index e8b9b80..2ddcd99 100644 --- a/sigi/apps/ocorrencias/filters.py +++ b/sigi/apps/ocorrencias/filters.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.contrib import admin -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.servidores.models import Servidor diff --git a/sigi/apps/ocorrencias/models.py b/sigi/apps/ocorrencias/models.py index 9f43f28..499f6ba 100644 --- a/sigi/apps/ocorrencias/models.py +++ b/sigi/apps/ocorrencias/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.core.exceptions import ValidationError from django.utils.safestring import mark_safe diff --git a/sigi/apps/ocorrencias/views.py b/sigi/apps/ocorrencias/views.py index d5d8296..681f4fc 100644 --- a/sigi/apps/ocorrencias/views.py +++ b/sigi/apps/ocorrencias/views.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.http import JsonResponse, Http404 from django.db.models import Q, Count -from django.utils.translation import ungettext, ugettext as _ +from django.utils.translation import ungettext, gettext as _ from django.shortcuts import get_object_or_404, render, HttpResponse from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST diff --git a/sigi/apps/parlamentares/admin.py b/sigi/apps/parlamentares/admin.py index 80c8ebc..c2c27f0 100644 --- a/sigi/apps/parlamentares/admin.py +++ b/sigi/apps/parlamentares/admin.py @@ -3,7 +3,7 @@ from django.contrib import admin from django.contrib.contenttypes import generic from django.http import HttpResponseRedirect, HttpResponse from django.utils.html import escape, escapejs -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.contatos.models import Telefone from sigi.apps.parlamentares.models import ( diff --git a/sigi/apps/parlamentares/models.py b/sigi/apps/parlamentares/models.py index f9c64fa..c4a9a8d 100644 --- a/sigi/apps/parlamentares/models.py +++ b/sigi/apps/parlamentares/models.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.casas.models import Orgao diff --git a/sigi/apps/parlamentares/reports.py b/sigi/apps/parlamentares/reports.py index 4e076b0..ec60439 100644 --- a/sigi/apps/parlamentares/reports.py +++ b/sigi/apps/parlamentares/reports.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.templatetags.static import static -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from geraldo import Report, DetailBand, Label, ObjectValue, ReportGroup, ReportBand, landscape, SubReport, BAND_WIDTH, SystemField from geraldo.graphics import Image from reportlab.lib.enums import TA_CENTER diff --git a/sigi/apps/relatorios/reports.py b/sigi/apps/relatorios/reports.py index 9bf82de..a5d4b7a 100644 --- a/sigi/apps/relatorios/reports.py +++ b/sigi/apps/relatorios/reports.py @@ -2,7 +2,7 @@ import os from django.templatetags.static import static -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from geraldo import Report, ReportBand, ObjectValue, DetailBand, Label, SystemField, BAND_WIDTH, FIELD_ACTION_COUNT, Line from geraldo.graphics import Image from reportlab.lib.colors import navy diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index d1d9a29..2ae9de5 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -5,7 +5,7 @@ from django.core.urlresolvers import reverse from django.forms.models import ModelForm from django.http import Http404, HttpResponseRedirect from django.utils.encoding import force_unicode -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.casas.admin import FuncionariosInline, GerentesInterlegisFilter from sigi.apps.casas.models import Orgao @@ -187,7 +187,7 @@ class ServicoAdmin(BaseModelAdmin): return HttpResponseRedirect('.') adicionar_servicos.short_description = _(u"Armazenar serviços no carrinho para exportar") - + def calcular_data_uso(self, request, queryset): for servico in queryset: servico.atualiza_data_uso() @@ -253,7 +253,7 @@ class ServicoAdmin(BaseModelAdmin): obj.casa_legislativa = Orgao.objects.get(pk=id_casa) return obj - + def changelist_view(self, request, extra_context=None): from sigi.apps.convenios.views import normaliza_data request.GET._mutable = True @@ -265,7 +265,7 @@ class ServicoAdmin(BaseModelAdmin): request, extra_context={'query_str': '?' + request.META['QUERY_STRING']} ) - + def adicionar_servicos(self, request, queryset): if 'carrinho_servicos' in request.session: q1 = len(request.session['carrinho_servicos']) diff --git a/sigi/apps/servicos/management/commands/atualiza_uso_servico.py b/sigi/apps/servicos/management/commands/atualiza_uso_servico.py index edc3404..f21a35b 100644 --- a/sigi/apps/servicos/management/commands/atualiza_uso_servico.py +++ b/sigi/apps/servicos/management/commands/atualiza_uso_servico.py @@ -22,7 +22,7 @@ # 02110-1301, USA. # from django.core.management.base import BaseCommand -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.servicos.models import Servico diff --git a/sigi/apps/servicos/models.py b/sigi/apps/servicos/models.py index ea66ac2..0eaf148 100644 --- a/sigi/apps/servicos/models.py +++ b/sigi/apps/servicos/models.py @@ -3,7 +3,7 @@ from datetime import date from django.db import models from sigi.apps.casas.models import Orgao, Funcionario -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class TipoServico(models.Model): diff --git a/sigi/apps/servicos/views.py b/sigi/apps/servicos/views.py index c5b5be7..1696cab 100644 --- a/sigi/apps/servicos/views.py +++ b/sigi/apps/servicos/views.py @@ -12,7 +12,7 @@ from django.http import HttpResponse from django.http.response import HttpResponseRedirect from django.shortcuts import render, render_to_response, get_object_or_404 from django.template.context import RequestContext -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.generic.base import TemplateView from sigi.apps.casas.models import Orgao @@ -163,7 +163,7 @@ def adicionar_servicos_carrinho(request, queryset=None, id=None): if id not in lista: lista.append(id) request.session['carrinho_servicos'] = lista - + def carrinhoOrGet_for_qs(request): """ Verifica se existe convênios na sessão se não verifica get e retorna qs correspondente. @@ -248,7 +248,7 @@ def visualizar_carrinho(request): 'query_str': '?' + request.META['QUERY_STRING'] } ) - + def get_for_qs(get, qs): kwargs = {} ids = 0 @@ -296,11 +296,11 @@ def export_csv(request): col_titles.insert(pos, _(u"email")) pos+=1 col_titles.insert(pos, _(u"telefone")) - + if _(u"Contato Interlegis") in col_titles: pos = col_titles.index(_(u"Contato Interlegis")) + 1 col_titles.insert(pos, _(u"Email do contato")) - + csv_writer.writerow([s.encode("utf-8") for s in col_titles]) for servico in servicos: diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index 7d19536..3c92f3d 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.contenttypes import generic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.contatos.models import Endereco, Telefone from sigi.apps.servidores.models import Servidor, Servico diff --git a/sigi/apps/servidores/forms.py b/sigi/apps/servidores/forms.py index 3f01a95..0825aae 100644 --- a/sigi/apps/servidores/forms.py +++ b/sigi/apps/servidores/forms.py @@ -2,7 +2,7 @@ from collections import namedtuple from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.servidores.models import Ferias, Licenca, Funcao, Servidor diff --git a/sigi/apps/servidores/management/commands/migra.py b/sigi/apps/servidores/management/commands/migra.py index c6187ca..0070b0b 100644 --- a/sigi/apps/servidores/management/commands/migra.py +++ b/sigi/apps/servidores/management/commands/migra.py @@ -5,7 +5,7 @@ import re from datetime import datetime from django.contrib.auth.models import User from django.core.management.base import BaseCommand -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from sigi.apps.contatos.models import Municipio from sigi.apps.servidores.models import Servidor, Servico, Subsecretaria diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 0bae16c..68588a1 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -2,7 +2,7 @@ from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save, pre_save -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class Servico(models.Model): nome = models.CharField(_(u'Setor'), max_length=250, null=True) diff --git a/sigi/apps/utils/admin_widgets.py b/sigi/apps/utils/admin_widgets.py index b377671..ba89490 100644 --- a/sigi/apps/utils/admin_widgets.py +++ b/sigi/apps/utils/admin_widgets.py @@ -1,6 +1,6 @@ from django.contrib.admin.widgets import AdminFileWidget from django.utils.safestring import mark_safe -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class AdminImageWidget(AdminFileWidget): diff --git a/sigi/apps/utils/email.py b/sigi/apps/utils/email.py index 9f9437f..f4a80d2 100644 --- a/sigi/apps/utils/email.py +++ b/sigi/apps/utils/email.py @@ -2,7 +2,7 @@ from django.conf import settings from django.core.mail import EmailMessage from django.template.loader import render_to_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ def enviar_email(from_email, subject, template, tags):