From 41f7cd31dfc570961fae2fff9ea3863d63092d13 Mon Sep 17 00:00:00 2001 From: xuxiaofei Date: Sat, 31 Oct 2020 01:26:05 +0800 Subject: [PATCH] fix: linked table error --- start.sh | 1 + vislib/views/source.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 start.sh diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..500ce26 --- /dev/null +++ b/start.sh @@ -0,0 +1 @@ +python3 manage.py runserver --settings=py_vislib.settings.prod diff --git a/vislib/views/source.py b/vislib/views/source.py index 97464ef..e855313 100644 --- a/vislib/views/source.py +++ b/vislib/views/source.py @@ -91,11 +91,11 @@ def sourceDetail(request, sourceId): @csrf_exempt def sourceTables(request, sourceId): + json_data = [] try: tables = SourceDataTable.objects.get(database=sourceId) tables = serializers.serialize('json', [tables]) tables = json.loads(tables) - json_data = [] for table in tables: json_data.append(table['fields']) @@ -162,8 +162,11 @@ def sourceTableSave(request): def sourceLinkedTables(request, sourceId): try: tables = SourceDataTable.objects.get(database=sourceId) + print(tables) tables = serializers.serialize('json', [tables]) + print(tables) tables = json.loads(tables) + print(tables) json_data = [] for table in tables: json_data.append(table['fields'])