forked from wiktor/spejstore-new
undefecate prop query :^)
This commit is contained in:
parent
2ff57e3e0a
commit
2690136711
|
@ -121,10 +121,13 @@ class PropSelectView(AutoResponseView):
|
||||||
# context = self.get_context_data()
|
# context = self.get_context_data()
|
||||||
with connection.cursor() as c:
|
with connection.cursor() as c:
|
||||||
c.execute("""
|
c.execute("""
|
||||||
select e from (
|
SELECT key, count(*) FROM
|
||||||
select skeys(props) as e, count(skeys(props)) as e_count
|
(SELECT (each(props)).key FROM storage_item) AS stat
|
||||||
from storage_item group by e order by e_count desc) as xD
|
WHERE key like %s
|
||||||
where e like %s limit 10;""", ['%' + self.term + '%'])
|
GROUP BY key
|
||||||
|
ORDER BY count DESC, key
|
||||||
|
limit 10;
|
||||||
|
""", ['%' + self.term + '%'])
|
||||||
props = [e[0] for e in c.fetchall()]
|
props = [e[0] for e in c.fetchall()]
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
'results': [
|
'results': [
|
||||||
|
|
Loading…
Reference in New Issue