editka.execute("""update geo_kantor_administrasi set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = %s, luas_tanah = %s, tinggi_bangunan = %s, perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit,namobj,remark,luas_bangunan,luat_tanah,tinggi_bangunan,perangkat,alamat,namafile,idkantor))
conn.commit()
conn.commit()
withconn.cursor()ashasiledit:
hasiledit.execute("""select namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, perangkat, gambar, alamat from geo_kantor_administrasi where id = %s"""%idkantor)
hasileditkantor=hasiledit.fetchall()
data={'status':'Success'}
data='SUCCESS'
info='data telah diperbaharui'
status=0
respon={'data':data,'info':info,'status':status}
returnResponse(respon)
@api_view(('POST',))
defdeletekantoradmin(request):
idkantor=request.POST.get('id')
try:
withconn.cursor()aseditka:
editka.execute("""update geo_kantor_administrasi set is_deleted = 1 where id = %s"""%(idkantor))