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 611ddb6b
authored
Feb 25, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perubahan loading routes and menus
1 parent
5bdff039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
opensipkd/base/__init__.py
opensipkd/base/__init__.py
View file @
611ddb6
...
@@ -726,7 +726,15 @@ class BaseApp():
...
@@ -726,7 +726,15 @@ class BaseApp():
def
route_from_csv
(
self
,
config
,
get_file
=
get_route_file
):
def
route_from_csv
(
self
,
config
,
get_file
=
get_route_file
):
with
get_file
(
"routes.csv"
)
as
f
:
with
get_file
(
"routes.csv"
)
as
f
:
rows
=
csv
.
DictReader
(
f
)
rows
=
csv
.
DictReader
(
f
)
self
.
add_menu
(
config
,
rows
)
new_routes
=
[]
for
row
in
rows
:
if
row
.
get
(
"parent_id"
)
or
row
.
get
(
"parent_id/routes.kode"
):
new_routes
[
len
(
new_routes
)
-
1
][
"children"
]
.
append
(
row
)
else
:
row
[
"children"
]
=
[]
new_routes
.
append
(
row
)
self
.
add_menu
(
config
,
new_routes
)
def
route_from_list
(
self
,
config
,
routs
=
routes
):
def
route_from_list
(
self
,
config
,
routs
=
routes
):
new_routes
=
[]
new_routes
=
[]
...
...
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