update
This commit is contained in:
@ -394,26 +394,6 @@ def publish_date(sender, instance, created, **kwargs):
|
||||
updateLineTable(mdl, fields)
|
||||
if instance.layerof == 3:
|
||||
updatePolygonTable(mdl, fields)
|
||||
# with open(csv_f, 'r') as txt_file:
|
||||
# reader = csv.reader(codecs.EncodedFile(txt_file, 'utf-8', 'utf-8-sig'), delimiter=",")
|
||||
# for ln in reader:
|
||||
# pass
|
||||
# print(str(ln))
|
||||
# fields = ln.split(",")
|
||||
# if instance.layerof == 2:
|
||||
# updateLineTable(mdl, fields)
|
||||
# if instance.layerof == 3:
|
||||
# updatePolygonTable(mdl, fields)
|
||||
#with open(csv, encoding='"utf-8-sig"') as txt_file:
|
||||
#with open(csv, 'r') as txt_file:
|
||||
# lns = txt_file.readlines()
|
||||
# print(lns)
|
||||
# for ln in lns:
|
||||
# fields = ln.split(",")
|
||||
# if instance.layerof == 2:
|
||||
# updateLineTable(mdl, fields)
|
||||
# if instance.layerof == 3:
|
||||
# updatePolygonTable(mdl, fields)
|
||||
|
||||
except Exception as e:
|
||||
print('##################',e)
|
||||
|
||||
@ -6,12 +6,15 @@ from .serializers import LocationSerializer, Location_lineSerializer, Location_p
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.parsers import JSONParser, MultiPartParser
|
||||
from .models import Location
|
||||
from .serializers import LocationSerializer
|
||||
|
||||
|
||||
|
||||
class LocationViewSet(viewsets.ModelViewSet):
|
||||
queryset=Location.objects.all()
|
||||
serializer_class=LocationSerializer
|
||||
filter_fields=["prefecture", "location_name"]
|
||||
|
||||
|
||||
class Location_lineViewSet(viewsets.ModelViewSet):
|
||||
@ -27,6 +30,7 @@ class Location_polygonViewSet(viewsets.ModelViewSet):
|
||||
class Jpn_Main_PerfViewSet(viewsets.ModelViewSet):
|
||||
queryset=JpnAdminMainPerf.objects.all()
|
||||
serializer_class=JPN_main_perfSerializer
|
||||
filter_fields = ["adm1_ja"]
|
||||
|
||||
class Jpn_PerfViewSet(viewsets.ModelViewSet):
|
||||
queryset=JpnAdminPerf.objects.all()
|
||||
|
||||
Reference in New Issue
Block a user