Commit 1279c7b2 by aa.gusti

perbaikan data struktur

1 parent 5f6fa59e
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
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
......@@ -226,7 +226,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
for key in keys:
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]
q = db_session.query(table).filter_by(**filter_)
......@@ -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
for c in columns_table:
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.flush()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!