Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1279c7b2
authored
Sep 05, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan data struktur
1 parent
5f6fa59e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
opensipkd/base/scripts/data/jabatan.csv
opensipkd/base/scripts/initializedb.py
opensipkd/base/scripts/data/jabatan.csv
View file @
1279c7b
kode,nama,jenis
01,Kepala,1
02,Sekretaris,1
03,Staf,1
04,Bendahara Umum Daerah,3
05,Kuasa Bendahara Umum Daerah,3
06,Pejabat Pelaksana Keuangan,3
07,Bendahara Penerimaan,3
08,Bendahara Pengeluaran,3
09,Pengurus Barang,3
10,PPTK,3
10,Pejabat PEmbuat Komitmen,3
\ No newline at end of file
\ No newline at end of file
kode,nama,jenis,status
01,Kepala,1,1
02,Sekretaris,1,1
03,Staf,1,1
04,Bendahara Umum Daerah,3,1
05,Kuasa Bendahara Umum Daerah,3,1
06,Pejabat Pelaksana Keuangan,3,1
07,Bendahara Penerimaan,3,1
08,Bendahara Pengeluaran,3,1
09,Pengurus Barang,3,1
10,PPTK,3,1
10,Pejabat PEmbuat Komitmen,3,1
\ No newline at end of file
\ No newline at end of file
opensipkd/base/scripts/initializedb.py
View file @
1279c7b
...
@@ -226,7 +226,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
...
@@ -226,7 +226,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
for
key
in
keys
:
for
key
in
keys
:
if
key
not
in
data
or
not
data
[
key
]:
if
key
not
in
data
or
not
data
[
key
]:
raise
Exception
(
f
"Field '{key}' wajib ada"
)
raise
Exception
(
f
"
Key
Field '{key}' wajib ada"
)
filter_
[
key
]
=
data
[
key
]
filter_
[
key
]
=
data
[
key
]
q
=
db_session
.
query
(
table
)
.
filter_by
(
**
filter_
)
q
=
db_session
.
query
(
table
)
.
filter_by
(
**
filter_
)
...
@@ -255,7 +255,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
...
@@ -255,7 +255,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
# Penambahan checking field nullable false wajib ada datanya 2024-09-05
# Penambahan checking field nullable false wajib ada datanya 2024-09-05
for
c
in
columns_table
:
for
c
in
columns_table
:
if
(
not
c
[
"nullable"
]
and
c
[
"name"
]
not
in
data
and
c
[
"name"
]
!=
"id"
):
if
(
not
c
[
"nullable"
]
and
c
[
"name"
]
not
in
data
and
c
[
"name"
]
!=
"id"
):
raise
Exception
(
f
"
Field '{c['name']}' wajib ada {c
} "
)
raise
Exception
(
f
"
Table {str(table.__name__)} Field '{c['name']}' wajib ada {c['type']
} "
)
db_session
.
add
(
row
)
db_session
.
add
(
row
)
db_session
.
flush
()
db_session
.
flush
()
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment