Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
0b0c9a0d
Commit
0b0c9a0d
authored
Jul 08, 2021
by
Muhamad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit
parent
dbfe6011
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
561 additions
and
1309 deletions
+561
-1309
Application/__pycache__/edit.cpython-37.pyc
Application/__pycache__/edit.cpython-37.pyc
+0
-0
Application/edit.py
Application/edit.py
+12
-5
templates/maps/edit.html
templates/maps/edit.html
+549
-1304
No files found.
Application/__pycache__/edit.cpython-37.pyc
View file @
0b0c9a0d
No preview for this file type
Application/edit.py
View file @
0b0c9a0d
from
decimal
import
Context
from
django.shortcuts
import
render
,
redirect
# from django.views.generic import ListView, DetailView, DeleteView, UpdateView, CreateView
from
django.views
import
View
,
generic
from
django.db
import
connection
as
conn
def
editkelurahan
(
request
):
kode_dagri
=
request
.
POST
.
get
(
'kode_dagri'
)
print
(
kode_dagri
)
return
render
(
request
,
'maps/edit.html'
)
if
request
.
method
==
'POST'
:
kode_dagri
=
request
.
POST
.
get
(
'kode_dagri'
)
with
conn
.
cursor
()
as
edit_poly
:
edit_poly
.
execute
(
"SELECT json_build_object('type', 'Feature', 'administrasi', (kode_desa, desa, kecamatan, kab_kota, provinsi, jumlah_pen, jumlah_kk, luas_desa),'penduduk', (pria, wanita, belum_kawin, kawin, cerai_hidup, cerai_mati, wajib_ktp, islam, kristen, khatolik, hindu, budha, konghucu, kepercayaan_lain, u0, u5, u10, u15, u20, u25, u30, u35, u40, u45, u50, u55, u60, u65, u70, u75),'pekerjaan_pendidikan', (tidak_sekolah, belum_tamat, tamat_sd, sltp, slta, diploma_i, diploma_ii, diploma_iv, strata_ii, strata_iii, tidak_bekerja, aparatur_pemerintah, tenaga_pendidik, wiraswasta, pertanian, tenaga_kesehatan, pensiunan, pegawai, tentara, kepolisian, pedagang, petani, peternak, nelayan, karyawan, buruh, pembantu, tukang, pendeta, pastor, ustadz, dosen, guru, pilot, pengacara, notaris, arsitek, akuntan, konsultan, dokter, bidan, perawat, psikiater, sopir, lainnya), 'poi',(jml_puskesma, jml_sekolah, jml_sarib),'geometry', ST_AsGeoJSON(geom :: geometry) :: json) from geo_data_kelurahan where kode_desa = '
%
s'"
%
kode_dagri
)
res_edit_poly
=
edit_poly
.
fetchall
()
print
(
res_edit_poly
)
context
=
{
'result_poly'
:
res_edit_poly
[
0
][
0
]}
return
render
(
request
,
'maps/edit.html'
,
context
)
\ No newline at end of file
if
request
.
method
==
'GET'
:
return
redirect
(
"apps:dashboard"
)
\ No newline at end of file
templates/maps/edit.html
View file @
0b0c9a0d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment