fix findPlace performance
This commit is contained in:
parent
9596248dc4
commit
02a2d00f9d
2 changed files with 1 additions and 1 deletions
|
@ -141,4 +141,5 @@ class PlaceManager(Manager):
|
||||||
user)
|
user)
|
||||||
if conditions:
|
if conditions:
|
||||||
qs = qs.filter(conditions)
|
qs = qs.filter(conditions)
|
||||||
|
qs = qs.distinct()
|
||||||
return qs
|
return qs
|
||||||
|
|
|
@ -239,7 +239,6 @@ def findPlaces(request, data):
|
||||||
qs = order_query(query['qs'], query['sort'])
|
qs = order_query(query['qs'], query['sort'])
|
||||||
qs = qs.distinct()
|
qs = qs.distinct()
|
||||||
if 'keys' in data:
|
if 'keys' in data:
|
||||||
qs = qs.select_related('user__profile')
|
|
||||||
qs = qs[query['range'][0]:query['range'][1]]
|
qs = qs[query['range'][0]:query['range'][1]]
|
||||||
response['data']['items'] = [p.json(data['keys'], request.user) for p in qs]
|
response['data']['items'] = [p.json(data['keys'], request.user) for p in qs]
|
||||||
elif 'position' in query:
|
elif 'position' in query:
|
||||||
|
|
Loading…
Reference in a new issue