From b3e220c4760f325e135b482fe2f69f9a4486ec8c Mon Sep 17 00:00:00 2001 From: Talitha Date: Fri, 3 Aug 2018 20:28:24 -0300 Subject: [PATCH] Fix #2104 Co-authored-by: Edward Ribeiro --- sapl/norma/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/norma/views.py b/sapl/norma/views.py index b364e95bd..f5fecdefc 100644 --- a/sapl/norma/views.py +++ b/sapl/norma/views.py @@ -72,7 +72,7 @@ class NormaPesquisaView(FilterView): def get_queryset(self): qs = super().get_queryset() - qs.select_related('tipo', 'materia') + qs = qs.extra({'norma_i': "CAST(regexp_replace(numero,'[^0-9]','', 'g') AS INTEGER)", 'norma_letra': "regexp_replace(numero,'[^a-zA-Z]','', 'g')"}).order_by('-data', '-norma_i', '-norma_letra') return qs