Advertisement
greathector7

definiendo diccionario

May 1st, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. class NacimientosView(ListView):
  2.     """Vista partidas de nacimientos pero filtrados desde un formulario"""
  3.     # queryset = PartidaNacimiento.objects.filter(folio=457).filter(ano=1980)
  4.     model = PartidaNacimiento
  5.     template_name = 'rcivil/nacimientos_listado.html'
  6.     paginate_by = 10
  7.     ordering = 'ano'
  8.  
  9.     def get_queryset(self):
  10.         CAMPOS = [
  11.             'tomo': {'lookup': 'exact', 'cast': int},
  12.             'folio': {'lookup': 'icontains', 'cast': str},
  13.         ]
  14.             if self.request.method == 'GET':
  15.             qs = super().get_queryset()
  16.             logging.debug(qs)
  17.             return qs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement