Browse Source

Corrige bug na pesquisa de possíveis autores.

pull/1190/head
LeandroRoberto 8 years ago
parent
commit
4c026df191
  1. 5
      sapl/api/views.py
  2. 3
      sapl/parlamentares/models.py

5
sapl/api/views.py

@ -238,9 +238,12 @@ class AutorListView(ListAPIView):
q_filter = q_filter & q_fs
qs = qs.filter(q_filter).distinct(
fields[0].fields_search[0][0]).order_by(
fields[0].fields_search[0][0])
else:
qs = qs.order_by(fields[0].fields_search[0][0])
qs = qs.order_by(fields[0].fields_search[0][0]).values_list(
qs = qs.values_list(
'id', fields[0].fields_search[0][0])
r += list(qs)

3
sapl/parlamentares/models.py

@ -1,9 +1,9 @@
from datetime import datetime
import reversion
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
import reversion
from sapl.base.models import Autor
from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES,
@ -305,7 +305,6 @@ class Parlamentar(models.Model):
('nome_completo', '__icontains'),
('nome_parlamentar', '__icontains'),
('filiacao__partido__sigla', '__icontains'),
('ativo', '', true_false_none),
))
class Meta:

Loading…
Cancel
Save