Stripping `content` field from receiving from postgresql while getting all charts
This commit is contained in:
parent
d8a57080a3
commit
b7ffa16b40
|
@ -66,7 +66,7 @@ def respondToOptionsRequest(requestHeaders):
|
|||
|
||||
|
||||
def getAllUserCharts(clientId, userId):
|
||||
chartsList = models.Chart.objects.filter(ownerSource = clientId, ownerId = userId)
|
||||
chartsList = models.Chart.objects.defer('content').filter(ownerSource = clientId, ownerId = userId)
|
||||
result = map(lambda x : {'id': x.id, 'name': x.name, 'timestamp': time.mktime(x.lastModified.timetuple()), 'symbol': x.symbol, 'resolution': x.resolution} , chartsList)
|
||||
return response(json.dumps({'status': "ok", 'data': list(result)}))
|
||||
|
||||
|
@ -116,4 +116,4 @@ def rewriteChart(clientId, userId, chartId, chartName, symbol, resolution, conte
|
|||
chart.save()
|
||||
return response(json.dumps({'status': 'ok'}))
|
||||
except:
|
||||
return error('Chart not found')
|
||||
return error('Chart not found')
|
||||
|
|
|
@ -54,7 +54,7 @@ def processRequest(request):
|
|||
|
||||
|
||||
def getAllUserCharts(clientId, userId):
|
||||
chartsList = models.Chart.objects.filter(ownerSource = clientId, ownerId = userId)
|
||||
chartsList = models.Chart.objects.defer('content').filter(ownerSource = clientId, ownerId = userId)
|
||||
result = map(lambda x : {'id': x.id, 'name': x.name, 'timestamp': time.mktime(x.lastModified.timetuple()), 'symbol': x.symbol, 'resolution': x.resolution} , chartsList)
|
||||
return common.response(json.dumps({'status': "ok", 'data': list(result)}))
|
||||
|
||||
|
|
Loading…
Reference in New Issue