From 6a3bda920e7307a361cac14d5b6a31086d5f2a62 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Wed, 22 Jun 2022 12:00:00 +0530 Subject: [PATCH] update for transation error --- rog/models.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rog/models.py b/rog/models.py index 8561c18..8373c7d 100644 --- a/rog/models.py +++ b/rog/models.py @@ -564,12 +564,22 @@ def publish_data(sender, instance, created, **kwargs): print(fields[0]) print("@@@@@@@@@@@@") if instance.layerof == 1: - insertShapeLayerLocation(instance.name, fields) + #insertShapeLayerLocation(instance.name, fields) updateLocation(mdl, fields) if instance.layerof == 2: updateLineTable(mdl, fields) if instance.layerof == 3: updatePolygonTable(mdl, fields) + + with open(csv_f, mode="r", encoding="utf-8") as txt_file: + reader_2 = csv.reader(txt_file, delimiter=",") + for fields in reader_2: + print("@@@@@@@@@@@@") + print(fields[0]) + print("@@@@@@@@@@@@") + if instance.layerof == 1: + insertShapeLayerLocation(instance.name, fields) + except Exception as e: print('##################',e)