Stripping `content` field from receiving from postgresql while getting all charts

This commit is contained in:
Evgeniy Timokhov 2020-01-28 12:27:14 +03:00
parent d8a57080a3
commit b7ffa16b40
2 changed files with 3 additions and 3 deletions

View File

@ -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)}))

View File

@ -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)}))