Browse Source

Ajuste de warnings do Django 1.7: metodos renomeados p get_queryset

producao
Marcio Mazza 10 years ago
parent
commit
d2a79c6823
  1. 2
      sigi/apps/casas/admin.py
  2. 4
      sigi/apps/casas/models.py
  3. 4
      sigi/apps/contatos/admin.py
  4. 2
      sigi/apps/convenios/admin.py
  5. 4
      sigi/apps/ocorrencias/admin.py
  6. 4
      sigi/apps/servicos/models.py

2
sigi/apps/casas/admin.py

@ -43,7 +43,7 @@ class FuncionariosInline(admin.StackedInline):
readonly_fields = ('ult_alteracao',)
extra = 1
inlines = (TelefonesInline,)
def queryset(self, request):
def get_queryset(self, request):
return self.model.objects.exclude(cargo="Presidente")

4
sigi/apps/casas/models.py

@ -288,8 +288,8 @@ class Funcionario(models.Model):
return self.nome
class PresidenteManager(models.Manager):
def get_query_set(self):
qs = super(PresidenteManager, self).get_query_set()
def get_queryset(self):
qs = super(PresidenteManager, self).get_queryset()
qs = qs.filter(setor='presidente')
return qs

4
sigi/apps/contatos/admin.py

@ -12,7 +12,7 @@ class UnidadeFederativaAdmin(admin.ModelAdmin):
list_display_links = ('codigo_ibge', 'nome')
list_filter = ('regiao', 'populacao', PopulationFilter,)
search_fields = ('search_text', 'codigo_ibge', 'sigla', 'regiao')
queryset = queryset_ascii
get_queryset = queryset_ascii
class MunicipioAdmin(admin.ModelAdmin):
actions = None
@ -20,7 +20,7 @@ class MunicipioAdmin(admin.ModelAdmin):
'pib_total', 'pib_percapita')
list_display_links = ('codigo_ibge', 'codigo_tse', 'nome')
list_filter = ('is_capital', 'is_polo', 'idh', 'populacao', 'uf', )
queryset = queryset_ascii
get_queryset = queryset_ascii
fieldsets = (
(None, {
'fields': ('codigo_ibge', 'codigo_tse', 'codigo_mesorregiao',

2
sigi/apps/convenios/admin.py

@ -59,7 +59,7 @@ class ConvenioAdmin(admin.ModelAdmin):
#date_hierarchy = 'data_adesao'
ordering = ('casa_legislativa__tipo__sigla','casa_legislativa__municipio__uf','casa_legislativa')
raw_id_fields = ('casa_legislativa',)
queryset = queryset_ascii
get_queryset = queryset_ascii
search_fields = ('id', 'search_text',#'casa_legislativa__nome',
'num_processo_sf','num_convenio')

4
sigi/apps/ocorrencias/admin.py

@ -22,7 +22,7 @@ class ComentarioInline(admin.StackedInline):
verbose_name, verbose_name_plural = u"Comentário novo", u"Comentários novos"
fieldsets = ((None, {'fields': (('novo_status', 'encaminhar_setor',), 'descricao', )}),)
def queryset(self, queryset):
def get_queryset(self, queryset):
return self.model.objects.get_query_set()
@ -42,7 +42,7 @@ class OcorrenciaChangeList(ChangeList):
date_hierarchy, search_fields, list_select_related, list_per_page,
list_max_show_all, list_editable, model_admin)
def get_query_set(self, request):
def get_queryset(self, request):
tmp_params = self.params.copy()
grupo = None
if 'grupo' in self.params:

4
sigi/apps/servicos/models.py

@ -167,8 +167,8 @@ class LogServico(models.Model):
verbose_name_plural = 'Logs do serviço'
class CasaAtendidaManager(models.Manager):
def get_query_set(self):
qs = super(CasaAtendidaManager, self).get_query_set()
def get_queryset(self):
qs = super(CasaAtendidaManager, self).get_queryset()
qs = qs.exclude(codigo_interlegis='')
return qs

Loading…
Cancel
Save