summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord42 <d42@users.noreply.github.com>2018-04-27 23:23:40 +0200
committerd42 <d42@users.noreply.github.com>2018-04-27 23:23:40 +0200
commitb8677eebecd29bbfce921203a7f8396a442c621d (patch)
treec038552bb8af1364bde4a61e0a3f29ab2c9c5d91
parentcbc3a791386a277a872b483baed7900ae43577e4 (diff)
downloadspejstore-b8677eebecd29bbfce921203a7f8396a442c621d.tar.gz
spejstore-b8677eebecd29bbfce921203a7f8396a442c621d.tar.bz2
spejstore-b8677eebecd29bbfce921203a7f8396a442c621d.zip
yolo
-rw-r--r--storage/templates/index.html4
-rw-r--r--storage/views.py7
-rw-r--r--templates/hstore_default_widget.html5
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 @@
<button class="btn btn-primary" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</span>
</div>
- <!-- <div class="text&#45;right"> -->
- <!-- <input type="checkbox" id="smartsearch" name="smartsearch"> -->
- <!-- <label for="smartsearch">SmartSearch</label> -->
- <!-- </div> -->
</form>
</div>
</div>
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 @@
</script>
<script>
- django.jQuery('a.hs-add-row').on('click', console.log);
django.jQuery(function() { initDjangoHStoreWidget('{{ field_name }}') });
-
- // function(e) {
- // $('.django-select2').select2();
- // });
</script>