From b8677eebecd29bbfce921203a7f8396a442c621d Mon Sep 17 00:00:00 2001 From: d42 Date: Fri, 27 Apr 2018 23:23:40 +0200 Subject: [PATCH] yolo --- storage/templates/index.html | 4 ---- storage/views.py | 7 +++++-- templates/hstore_default_widget.html | 5 ----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/storage/templates/index.html b/storage/templates/index.html index 58a853d..4d268e3 100644 --- a/storage/templates/index.html +++ b/storage/templates/index.html @@ -10,10 +10,6 @@ - - - - diff --git a/storage/views.py b/storage/views.py index d11d515..68fbdf2 100644 --- a/storage/views.py +++ b/storage/views.py @@ -5,7 +5,6 @@ from django.contrib.postgres.search import SearchVector, TrigramSimilarity from django.http import Http404, JsonResponse from django.contrib.admin.models import LogEntry from django_select2.views import AutoResponseView -from django.db.models import Q from django.db import connection from storage.models import Item, Label @@ -122,7 +121,11 @@ class PropSelectView(AutoResponseView): self.term = kwargs.get('term', request.GET.get('term', '')) # context = self.get_context_data() with connection.cursor() as c: - c.execute("select e from (select skeys(props) as e, count(skeys(props)) as e_count from storage_item group by e order by e_count desc) as xD where e like %s limit 10;", ['%' + self.term + '%']) + c.execute(""" + select e from ( + select skeys(props) as e, count(skeys(props)) as e_count + from storage_item group by e order by e_count desc) as xD + where e like %s limit 10;""", ['%' + self.term + '%']) props = c.fetchall() return JsonResponse({ diff --git a/templates/hstore_default_widget.html b/templates/hstore_default_widget.html index 29774ff..de60c19 100644 --- a/templates/hstore_default_widget.html +++ b/templates/hstore_default_widget.html @@ -66,10 +66,5 @@