Browse Source

Trocar ugettext por gettext

revisaoSidenav
Sesostris Vieira 3 years ago
parent
commit
9db2b0a27a
  1. 6
      sigi/apps/casas/admin.py
  2. 2
      sigi/apps/casas/forms.py
  3. 2
      sigi/apps/casas/models.py
  4. 2
      sigi/apps/casas/reports.py
  5. 2
      sigi/apps/casas/views.py
  6. 8
      sigi/apps/contatos/admin.py
  7. 2
      sigi/apps/contatos/filters.py
  8. 2
      sigi/apps/contatos/models.py
  9. 2
      sigi/apps/convenios/admin.py
  10. 2
      sigi/apps/convenios/models.py
  11. 6
      sigi/apps/convenios/reports.py
  12. 2
      sigi/apps/convenios/views.py
  13. 2
      sigi/apps/diagnosticos/admin.py
  14. 2
      sigi/apps/diagnosticos/forms.py
  15. 2
      sigi/apps/diagnosticos/models.py
  16. 2
      sigi/apps/diagnosticos/views.py
  17. 2
      sigi/apps/eventos/admin.py
  18. 2
      sigi/apps/eventos/forms.py
  19. 2
      sigi/apps/eventos/models.py
  20. 28
      sigi/apps/eventos/views.py
  21. 2
      sigi/apps/financeiro/models.py
  22. 2
      sigi/apps/home/views.py
  23. 2
      sigi/apps/inventario/models.py
  24. 2
      sigi/apps/metas/admin.py
  25. 2
      sigi/apps/metas/models.py
  26. 2
      sigi/apps/metas/views.py
  27. 2
      sigi/apps/ocorrencias/admin.py
  28. 2
      sigi/apps/ocorrencias/filters.py
  29. 2
      sigi/apps/ocorrencias/models.py
  30. 2
      sigi/apps/ocorrencias/views.py
  31. 2
      sigi/apps/parlamentares/admin.py
  32. 2
      sigi/apps/parlamentares/models.py
  33. 2
      sigi/apps/parlamentares/reports.py
  34. 2
      sigi/apps/relatorios/reports.py
  35. 8
      sigi/apps/servicos/admin.py
  36. 2
      sigi/apps/servicos/management/commands/atualiza_uso_servico.py
  37. 2
      sigi/apps/servicos/models.py
  38. 10
      sigi/apps/servicos/views.py
  39. 2
      sigi/apps/servidores/admin.py
  40. 2
      sigi/apps/servidores/forms.py
  41. 2
      sigi/apps/servidores/management/commands/migra.py
  42. 2
      sigi/apps/servidores/models.py
  43. 2
      sigi/apps/utils/admin_widgets.py
  44. 2
      sigi/apps/utils/email.py

6
sigi/apps/casas/admin.py

@ -6,7 +6,7 @@ from django.contrib.contenttypes import generic
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.shortcuts import render 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 geraldo.site.newsite.django_1_0.django.forms import extras
from image_cropping import ImageCroppingMixin from image_cropping import ImageCroppingMixin
@ -85,7 +85,7 @@ class FuncionariosInline(admin.StackedInline):
'endereco', 'municipio', 'bairro', 'cep', 'redes_sociais', 'endereco', 'municipio', 'bairro', 'cep', 'redes_sociais',
'desativado', 'observacoes') 'desativado', 'observacoes')
raw_id_fields = ('municipio',) raw_id_fields = ('municipio',)
# fieldsets = ((None, { # fieldsets = ((None, {
# 'fields': ( # 'fields': (
# ('nome', 'sexo', 'data_nascimento'), # ('nome', 'sexo', 'data_nascimento'),
@ -336,7 +336,7 @@ class ExcluirConvenioFilter(admin.SimpleListFilter):
def queryset(self, request, queryset): def queryset(self, request, queryset):
if (self.value() is None): if (self.value() is None):
return queryset return queryset
else: else:
queryset = queryset.exclude(convenio__projeto_id=self.value()).distinct('municipio__uf__nome', 'nome') queryset = queryset.exclude(convenio__projeto_id=self.value()).distinct('municipio__uf__nome', 'nome')
return queryset return queryset

2
sigi/apps/casas/forms.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django import forms 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 localflavor.br.forms import BRZipCodeField
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao

2
sigi/apps/casas/models.py

@ -4,7 +4,7 @@ import random
from string import ascii_uppercase from string import ascii_uppercase
from unicodedata import normalize from unicodedata import normalize
from django.core.exceptions import ValidationError 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.contrib.contenttypes.fields import GenericRelation
from django.db import models from django.db import models
from image_cropping import ImageRatioField from image_cropping import ImageRatioField

2
sigi/apps/casas/reports.py

@ -3,7 +3,7 @@ from geraldo import Report, DetailBand, Label, ObjectValue, ReportGroup, ReportB
from geraldo.graphics import Image from geraldo.graphics import Image
from django.templatetags.static import static 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.enums import TA_CENTER
from reportlab.lib.pagesizes import A4 from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm from reportlab.lib.units import cm

2
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.db.models import Count, Q
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render, get_object_or_404 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 django.views.generic import View
from sigi.apps.casas.forms import PortfolioForm, AtualizaCasaForm from sigi.apps.casas.forms import PortfolioForm, AtualizaCasaForm

8
sigi/apps/contatos/admin.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin 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.filters import PopulationFilter
from sigi.apps.contatos.models import (UnidadeFederativa, Mesorregiao, Microrregiao, 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): class MesorregiaoInline(admin.TabularInline):
model = Mesorregiao model = Mesorregiao
class MicrorregiaoInline(admin.TabularInline): class MicrorregiaoInline(admin.TabularInline):
model = Microrregiao model = Microrregiao
class UnidadeFederativaAdmin(BaseModelAdmin): class UnidadeFederativaAdmin(BaseModelAdmin):
actions = None actions = None
list_display = ('codigo_ibge', 'nome', 'sigla', 'regiao', 'populacao') list_display = ('codigo_ibge', 'nome', 'sigla', 'regiao', 'populacao')
@ -22,7 +22,7 @@ class UnidadeFederativaAdmin(BaseModelAdmin):
search_fields = ('search_text', 'codigo_ibge', 'sigla', 'regiao') search_fields = ('search_text', 'codigo_ibge', 'sigla', 'regiao')
get_queryset = queryset_ascii get_queryset = queryset_ascii
inlines = (MesorregiaoInline, ) inlines = (MesorregiaoInline, )
class MesorregiaoAdmin(BaseModelAdmin): class MesorregiaoAdmin(BaseModelAdmin):
actions = None actions = None
list_display = ('codigo_ibge', 'uf', 'nome') list_display = ('codigo_ibge', 'uf', 'nome')

2
sigi/apps/contatos/filters.py

@ -1,6 +1,6 @@
# coding: utf-8 # coding: utf-8
from django.contrib import admin from django.contrib import admin
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
class PopulationFilter(admin.SimpleListFilter): class PopulationFilter(admin.SimpleListFilter):

2
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.contrib.contenttypes.models import ContentType
from django.core.validators import MaxValueValidator, MinValueValidator from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models 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 from sigi.apps.utils import SearchField

2
sigi/apps/convenios/admin.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin from django.contrib import admin
from django.http import HttpResponse, HttpResponseRedirect 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 geraldo.generators import PDFGenerator
from sigi.apps.convenios.models import (Projeto, StatusConvenio, from sigi.apps.convenios.models import (Projeto, StatusConvenio,

2
sigi/apps/convenios/models.py

@ -6,7 +6,7 @@ from django.db import models
from django.db.models import Q, fields from django.db.models import Q, fields
from django.core.mail import send_mail from django.core.mail import send_mail
from django.core.urlresolvers import reverse 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.utils import SearchField, to_ascii
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao
from sigi.apps.servidores.models import Servidor, Servico from sigi.apps.servidores.models import Servidor, Servico

6
sigi/apps/convenios/reports.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- 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 geraldo import ReportBand, ObjectValue, Label, ReportGroup, FIELD_ACTION_SUM
from reportlab.lib.units import cm from reportlab.lib.units import cm
@ -27,7 +27,7 @@ class SemEquipamentosReport(object):
class ConvenioReport(ReportDefault): class ConvenioReport(ReportDefault):
title = _(u'Relatório de Parcerias') title = _(u'Relatório de Parcerias')
class band_page_header(ReportDefault.band_page_header): class band_page_header(ReportDefault.band_page_header):
label_top = ReportDefault.band_page_header.label_top label_top = ReportDefault.band_page_header.label_top
@ -160,7 +160,7 @@ class ConvenioReportSemAceite(ConvenioReport):
left=label_left[2] * cm, left=label_left[2] * cm,
top=label_top, top=label_top,
width=2 * cm, width=2 * cm,
), ),
Label( Label(
text=_(u"Projeto"), text=_(u"Projeto"),
left=label_left[3] * cm, left=label_left[3] * cm,

2
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.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_list_or_404 from django.shortcuts import render, get_list_or_404
from django.template import Context, loader 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 geraldo.generators import PDFGenerator
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao

2
sigi/apps/diagnosticos/admin.py

@ -2,7 +2,7 @@
from datetime import datetime from datetime import datetime
from django.contrib import admin from django.contrib import admin
from django.db.utils import OperationalError, ProgrammingError 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 eav.admin import BaseEntityAdmin, BaseSchemaAdmin
from sigi.apps.diagnosticos.forms import DiagnosticoForm from sigi.apps.diagnosticos.forms import DiagnosticoForm

2
sigi/apps/diagnosticos/forms.py

@ -7,7 +7,7 @@ from django.forms import (BooleanField, CharField, DateField,
FloatField, ModelChoiceField, Textarea, FloatField, ModelChoiceField, Textarea,
ModelMultipleChoiceField) ModelMultipleChoiceField)
from django.forms.forms import BoundField 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.fields import RangeField
from eav.forms import BaseDynamicEntityForm from eav.forms import BaseDynamicEntityForm

2
sigi/apps/diagnosticos/models.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from datetime import datetime from datetime import datetime
from django.db import models 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 eav.models import BaseChoice, BaseEntity, BaseSchema, BaseAttribute
from sigi.apps.utils import SearchField from sigi.apps.utils import SearchField

2
sigi/apps/diagnosticos/views.py

@ -5,7 +5,7 @@ from itertools import cycle
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render_to_response, get_object_or_404 from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext 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 django.views.decorators.cache import never_cache
from sigi.apps.casas.models import Funcionario from sigi.apps.casas.models import Funcionario

2
sigi/apps/eventos/admin.py

@ -22,7 +22,7 @@ from django import forms
from django.contrib import admin from django.contrib import admin
from django.db import models from django.db import models
from django.http import HttpResponseRedirect 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, from sigi.apps.eventos.models import (ModeloDeclaracao, Modulo, TipoEvento,
Funcao, Evento, Equipe, Convite, Anexo) Funcao, Evento, Equipe, Convite, Anexo)
from sigi.apps.eventos.views import adicionar_eventos_carrinho from sigi.apps.eventos.views import adicionar_eventos_carrinho

2
sigi/apps/eventos/forms.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django import forms 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 from sigi.apps.eventos.models import ModeloDeclaracao, Evento
class EventoAdminForm(forms.ModelForm): class EventoAdminForm(forms.ModelForm):

2
sigi/apps/eventos/models.py

@ -4,7 +4,7 @@ import random
from django.db import models from django.db import models
from django.db.models import Sum from django.db.models import Sum
from django.utils.functional import lazy 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 django.contrib.contenttypes import generic
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao
from sigi.apps.contatos.models import Municipio from sigi.apps.contatos.models import Municipio

28
sigi/apps/eventos/views.py

@ -29,7 +29,7 @@ from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, render from django.shortcuts import get_object_or_404, render
from django.utils import translation 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.http.response import JsonResponse, HttpResponse
from django.template import Template, Context from django.template import Template, Context
from sigi.apps.eventos.models import Evento, Equipe, Convite, Modulo from sigi.apps.eventos.models import Evento, Equipe, Convite, Modulo
@ -300,13 +300,13 @@ def deleta_itens_carrinho(request):
@login_required @login_required
def export_csv(request): def export_csv(request):
def rm_rows(lista,reg): def rm_rows(lista,reg):
for a in lista: for a in lista:
if a in lista: if a in lista:
reg.pop(a,None) reg.pop(a,None)
else: else:
pass pass
def serialize(r, field): def serialize(r, field):
value = (getattr(r, 'get_{0}_display'.format(field.name), None) or value = (getattr(r, 'get_{0}_display'.format(field.name), None) or
getattr(r, field.name, "")) getattr(r, field.name, ""))
@ -343,15 +343,15 @@ def export_csv(request):
response['Content-Disposition'] = 'attachment; filename=eventos.csv' 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'] rm_list = ['Descrição do evento', 'Local do evento', 'Público alvo', 'Motivo do cancelamento', 'Descrição do módulo']
for a in head: for a in head:
if 'Observações_' in a: if 'Observações_' in a:
rm_list.append(a) rm_list.append(a)
for a in rm_list: for a in rm_list:
if a in head: if a in head:
head.remove(a) head.remove(a)
else: else:
pass pass
writer = csv.DictWriter(response, fieldnames=head) writer = csv.DictWriter(response, fieldnames=head)
writer.writeheader() writer.writeheader()
@ -387,12 +387,12 @@ def export_csv(request):
) )
rm_rows(rm_list,reg) rm_rows(rm_list,reg)
writer.writerow(reg) writer.writerow(reg)
if evento.convite_set.count() == 0: if evento.convite_set.count() == 0:
rm_rows(rm_list,reg) rm_rows(rm_list,reg)
writer.writerow(reg) writer.writerow(reg)
return response return response
@login_required @login_required

2
sigi/apps/financeiro/models.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models 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 from sigi.apps.convenios.models import Projeto

2
sigi/apps/home/views.py

@ -25,7 +25,7 @@
import datetime import datetime
import calendar import calendar
from django.shortcuts import render, get_object_or_404 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 itertools import cycle
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao
from sigi.apps.convenios.models import Convenio, Projeto from sigi.apps.convenios.models import Convenio, Projeto

2
sigi/apps/inventario/models.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.fields import GenericRelation
from django.db import models from django.db import models
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
class Fornecedor(models.Model): class Fornecedor(models.Model):

2
sigi/apps/metas/admin.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin 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.metas.models import PlanoDiretor
from sigi.apps.utils.base_admin import BaseModelAdmin from sigi.apps.utils.base_admin import BaseModelAdmin

2
sigi/apps/metas/models.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from datetime import date from datetime import date
from django.db import models 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.casas.models import Orgao
from sigi.apps.convenios.models import Projeto, Convenio from sigi.apps.convenios.models import Projeto, Convenio

2
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.shortcuts import get_object_or_404, render, render_to_response
from django.template import RequestContext from django.template import RequestContext
from django.utils.datastructures import SortedDict 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 django.views.decorators.cache import cache_page
from easy_thumbnails.templatetags.thumbnail import thumbnail_url from easy_thumbnails.templatetags.thumbnail import thumbnail_url

2
sigi/apps/ocorrencias/admin.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin from django.contrib import admin
from django.contrib.admin.views.main import ChangeList 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.filters import OcorrenciaListFilter
from sigi.apps.ocorrencias.models import Ocorrencia, Comentario, Anexo, Categoria, TipoContato from sigi.apps.ocorrencias.models import Ocorrencia, Comentario, Anexo, Categoria, TipoContato

2
sigi/apps/ocorrencias/filters.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin 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 from sigi.apps.servidores.models import Servidor

2
sigi/apps/ocorrencias/models.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from django.conf import settings 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.core.exceptions import ValidationError
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe

2
sigi/apps/ocorrencias/views.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.http import JsonResponse, Http404 from django.http import JsonResponse, Http404
from django.db.models import Q, Count 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.shortcuts import get_object_or_404, render, HttpResponse
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_POST from django.views.decorators.http import require_POST

2
sigi/apps/parlamentares/admin.py

@ -3,7 +3,7 @@ from django.contrib import admin
from django.contrib.contenttypes import generic from django.contrib.contenttypes import generic
from django.http import HttpResponseRedirect, HttpResponse from django.http import HttpResponseRedirect, HttpResponse
from django.utils.html import escape, escapejs 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.contatos.models import Telefone
from sigi.apps.parlamentares.models import ( from sigi.apps.parlamentares.models import (

2
sigi/apps/parlamentares/models.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models 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.casas.models import Orgao

2
sigi/apps/parlamentares/reports.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.templatetags.static import static 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 import Report, DetailBand, Label, ObjectValue, ReportGroup, ReportBand, landscape, SubReport, BAND_WIDTH, SystemField
from geraldo.graphics import Image from geraldo.graphics import Image
from reportlab.lib.enums import TA_CENTER from reportlab.lib.enums import TA_CENTER

2
sigi/apps/relatorios/reports.py

@ -2,7 +2,7 @@
import os import os
from django.templatetags.static import static 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 import Report, ReportBand, ObjectValue, DetailBand, Label, SystemField, BAND_WIDTH, FIELD_ACTION_COUNT, Line
from geraldo.graphics import Image from geraldo.graphics import Image
from reportlab.lib.colors import navy from reportlab.lib.colors import navy

8
sigi/apps/servicos/admin.py

@ -5,7 +5,7 @@ from django.core.urlresolvers import reverse
from django.forms.models import ModelForm from django.forms.models import ModelForm
from django.http import Http404, HttpResponseRedirect from django.http import Http404, HttpResponseRedirect
from django.utils.encoding import force_unicode 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.admin import FuncionariosInline, GerentesInterlegisFilter
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao
@ -187,7 +187,7 @@ class ServicoAdmin(BaseModelAdmin):
return HttpResponseRedirect('.') return HttpResponseRedirect('.')
adicionar_servicos.short_description = _(u"Armazenar serviços no carrinho para exportar") adicionar_servicos.short_description = _(u"Armazenar serviços no carrinho para exportar")
def calcular_data_uso(self, request, queryset): def calcular_data_uso(self, request, queryset):
for servico in queryset: for servico in queryset:
servico.atualiza_data_uso() servico.atualiza_data_uso()
@ -253,7 +253,7 @@ class ServicoAdmin(BaseModelAdmin):
obj.casa_legislativa = Orgao.objects.get(pk=id_casa) obj.casa_legislativa = Orgao.objects.get(pk=id_casa)
return obj return obj
def changelist_view(self, request, extra_context=None): def changelist_view(self, request, extra_context=None):
from sigi.apps.convenios.views import normaliza_data from sigi.apps.convenios.views import normaliza_data
request.GET._mutable = True request.GET._mutable = True
@ -265,7 +265,7 @@ class ServicoAdmin(BaseModelAdmin):
request, request,
extra_context={'query_str': '?' + request.META['QUERY_STRING']} extra_context={'query_str': '?' + request.META['QUERY_STRING']}
) )
def adicionar_servicos(self, request, queryset): def adicionar_servicos(self, request, queryset):
if 'carrinho_servicos' in request.session: if 'carrinho_servicos' in request.session:
q1 = len(request.session['carrinho_servicos']) q1 = len(request.session['carrinho_servicos'])

2
sigi/apps/servicos/management/commands/atualiza_uso_servico.py

@ -22,7 +22,7 @@
# 02110-1301, USA. # 02110-1301, USA.
# #
from django.core.management.base import BaseCommand 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 from sigi.apps.servicos.models import Servico

2
sigi/apps/servicos/models.py

@ -3,7 +3,7 @@
from datetime import date from datetime import date
from django.db import models from django.db import models
from sigi.apps.casas.models import Orgao, Funcionario 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): class TipoServico(models.Model):

10
sigi/apps/servicos/views.py

@ -12,7 +12,7 @@ from django.http import HttpResponse
from django.http.response import HttpResponseRedirect from django.http.response import HttpResponseRedirect
from django.shortcuts import render, render_to_response, get_object_or_404 from django.shortcuts import render, render_to_response, get_object_or_404
from django.template.context import RequestContext 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 django.views.generic.base import TemplateView
from sigi.apps.casas.models import Orgao 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: if id not in lista:
lista.append(id) lista.append(id)
request.session['carrinho_servicos'] = lista request.session['carrinho_servicos'] = lista
def carrinhoOrGet_for_qs(request): def carrinhoOrGet_for_qs(request):
""" """
Verifica se existe convênios na sessão se não verifica get e retorna qs correspondente. 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'] 'query_str': '?' + request.META['QUERY_STRING']
} }
) )
def get_for_qs(get, qs): def get_for_qs(get, qs):
kwargs = {} kwargs = {}
ids = 0 ids = 0
@ -296,11 +296,11 @@ def export_csv(request):
col_titles.insert(pos, _(u"email")) col_titles.insert(pos, _(u"email"))
pos+=1 pos+=1
col_titles.insert(pos, _(u"telefone")) col_titles.insert(pos, _(u"telefone"))
if _(u"Contato Interlegis") in col_titles: if _(u"Contato Interlegis") in col_titles:
pos = col_titles.index(_(u"Contato Interlegis")) + 1 pos = col_titles.index(_(u"Contato Interlegis")) + 1
col_titles.insert(pos, _(u"Email do contato")) col_titles.insert(pos, _(u"Email do contato"))
csv_writer.writerow([s.encode("utf-8") for s in col_titles]) csv_writer.writerow([s.encode("utf-8") for s in col_titles])
for servico in servicos: for servico in servicos:

2
sigi/apps/servidores/admin.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin from django.contrib import admin
from django.contrib.contenttypes import generic 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.contatos.models import Endereco, Telefone
from sigi.apps.servidores.models import Servidor, Servico from sigi.apps.servidores.models import Servidor, Servico

2
sigi/apps/servidores/forms.py

@ -2,7 +2,7 @@
from collections import namedtuple from collections import namedtuple
from django import forms 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 from sigi.apps.servidores.models import Ferias, Licenca, Funcao, Servidor

2
sigi/apps/servidores/management/commands/migra.py

@ -5,7 +5,7 @@ import re
from datetime import datetime from datetime import datetime
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.management.base import BaseCommand 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.contatos.models import Municipio
from sigi.apps.servidores.models import Servidor, Servico, Subsecretaria from sigi.apps.servidores.models import Servidor, Servico, Subsecretaria

2
sigi/apps/servidores/models.py

@ -2,7 +2,7 @@
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db import models from django.db import models
from django.db.models.signals import post_save, pre_save 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): class Servico(models.Model):
nome = models.CharField(_(u'Setor'), max_length=250, null=True) nome = models.CharField(_(u'Setor'), max_length=250, null=True)

2
sigi/apps/utils/admin_widgets.py

@ -1,6 +1,6 @@
from django.contrib.admin.widgets import AdminFileWidget from django.contrib.admin.widgets import AdminFileWidget
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
class AdminImageWidget(AdminFileWidget): class AdminImageWidget(AdminFileWidget):

2
sigi/apps/utils/email.py

@ -2,7 +2,7 @@
from django.conf import settings from django.conf import settings
from django.core.mail import EmailMessage from django.core.mail import EmailMessage
from django.template.loader import render_to_string 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): def enviar_email(from_email, subject, template, tags):

Loading…
Cancel
Save