From b7ffa16b4014800209e6000a174dc925f2302c57 Mon Sep 17 00:00:00 2001 From: Evgeniy Timokhov Date: Tue, 28 Jan 2020 12:27:14 +0300 Subject: [PATCH] Stripping `content` field from receiving from postgresql while getting all charts --- api/v10/views.py | 4 ++-- api/v11/charts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v10/views.py b/api/v10/views.py index dff4e88..9bee0ed 100755 --- a/api/v10/views.py +++ b/api/v10/views.py @@ -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') \ No newline at end of file + return error('Chart not found') diff --git a/api/v11/charts.py b/api/v11/charts.py index 407800f..0444b6e 100644 --- a/api/v11/charts.py +++ b/api/v11/charts.py @@ -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)}))