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 91fb10a3
authored
Nov 21, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan base_views upload
1 parent
94bd0deb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
opensipkd/base/scripts/initializedb.py
opensipkd/base/views/base_views.py
opensipkd/base/scripts/initializedb.py
View file @
91fb10a
import
logging
import
os
import
os
import
sys
import
sys
import
csv
import
csv
...
@@ -20,6 +21,7 @@ from opensipkd.models import (
...
@@ -20,6 +21,7 @@ from opensipkd.models import (
from
sqlalchemy.dialects
import
oracle
from
sqlalchemy.dialects
import
oracle
from
sqlalchemy
import
text
from
sqlalchemy
import
text
log
=
logging
.
getLogger
(
__name__
)
# , mssql
# , mssql
# from .tools import mkdir
# from .tools import mkdir
...
@@ -144,6 +146,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
...
@@ -144,6 +146,7 @@ def append_csv(table, filename, keys, get_file_func=get_file,
is_first
=
True
is_first
=
True
fmap
=
dict
()
fmap
=
dict
()
for
cf
in
reader
:
for
cf
in
reader
:
log
.
info
(
cf
)
if
is_first
:
if
is_first
:
is_first
=
False
is_first
=
False
for
fname
in
cf
.
keys
():
for
fname
in
cf
.
keys
():
...
...
opensipkd/base/views/base_views.py
View file @
91fb10a
...
@@ -286,7 +286,9 @@ class BaseView(object):
...
@@ -286,7 +286,9 @@ class BaseView(object):
if
not
data
:
if
not
data
:
break
break
output_file
.
write
(
data
)
output_file
.
write
(
data
)
output_file
.
close
()
self
.
save_upload
(
fullpath
)
self
.
save_upload
(
fullpath
)
elif
"cancel"
in
self
.
req
.
POST
or
'batal'
in
self
.
req
.
POST
or
"close"
in
self
.
req
.
POST
:
elif
"cancel"
in
self
.
req
.
POST
or
'batal'
in
self
.
req
.
POST
or
"close"
in
self
.
req
.
POST
:
self
.
cancel_act
()
self
.
cancel_act
()
else
:
else
:
...
...
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