remove _
This commit is contained in:
parent
6cc4e1d045
commit
e0414588ba
2 changed files with 5 additions and 5 deletions
|
@ -16,7 +16,7 @@ from ox.django.views import task_status
|
||||||
|
|
||||||
from item import utils
|
from item import utils
|
||||||
from item.models import get_item
|
from item.models import get_item
|
||||||
from item.views import _parse_query
|
from item.views import parse_query
|
||||||
import item.tasks
|
import item.tasks
|
||||||
from api.actions import actions
|
from api.actions import actions
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ Positions
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
if settings.JSON_DEBUG:
|
if settings.JSON_DEBUG:
|
||||||
print json.dumps(data, indent=2)
|
print json.dumps(data, indent=2)
|
||||||
query = _parse_query(data, request.user)
|
query = parse_query(data, request.user)
|
||||||
|
|
||||||
response = json_response({})
|
response = json_response({})
|
||||||
if 'group' in query:
|
if 'group' in query:
|
||||||
|
|
|
@ -79,7 +79,7 @@ def _order_by_group(query):
|
||||||
order_by = ('-value_sort', 'items')
|
order_by = ('-value_sort', 'items')
|
||||||
return order_by
|
return order_by
|
||||||
|
|
||||||
def _parse_query(data, user):
|
def parse_query(data, user):
|
||||||
query = {}
|
query = {}
|
||||||
query['range'] = [0, 100]
|
query['range'] = [0, 100]
|
||||||
query['sort'] = [{'key':'title', 'operator':'+'}]
|
query['sort'] = [{'key':'title', 'operator':'+'}]
|
||||||
|
@ -166,7 +166,7 @@ Positions
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
if settings.JSON_DEBUG:
|
if settings.JSON_DEBUG:
|
||||||
print json.dumps(data, indent=2)
|
print json.dumps(data, indent=2)
|
||||||
query = _parse_query(data, request.user)
|
query = parse_query(data, request.user)
|
||||||
|
|
||||||
response = json_response({})
|
response = json_response({})
|
||||||
if 'group' in query:
|
if 'group' in query:
|
||||||
|
@ -271,7 +271,7 @@ def autocomplete(request):
|
||||||
order_by = '-items'
|
order_by = '-items'
|
||||||
sort_type = key.get('sort', key.get('type', 'string'))
|
sort_type = key.get('sort', key.get('type', 'string'))
|
||||||
if sort_type == 'title':
|
if sort_type == 'title':
|
||||||
qs = _parse_query({'query': data.get('query', {})}, request.user)['qs']
|
qs = parse_query({'query': data.get('query', {})}, request.user)['qs']
|
||||||
if data['value']:
|
if data['value']:
|
||||||
if op == '':
|
if op == '':
|
||||||
qs = qs.filter(find__key=data['key'], find__value__icontains=data['value'])
|
qs = qs.filter(find__key=data['key'], find__value__icontains=data['value'])
|
||||||
|
|
Loading…
Reference in a new issue