Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4f3d6d34
authored
Jan 16, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penambahan get_routes
1 parent
c86bc624
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
opensipkd/base/views/base_views.py
opensipkd/detable/detable.py
opensipkd/base/views/base_views.py
View file @
4f3d6d3
...
@@ -188,14 +188,20 @@ class BaseView(object):
...
@@ -188,14 +188,20 @@ class BaseView(object):
def
query_register
(
self
,
**
kwargs
):
def
query_register
(
self
,
**
kwargs
):
pass
pass
def
get_routes
(
self
):
"""
Digunakan untuk mendapatkan default url apabula list_url tidak ada
"""
def
route_list
(
self
,
**
kwargs
):
def
route_list
(
self
,
**
kwargs
):
msg
=
kwargs
.
get
(
"msg"
)
msg
=
kwargs
.
get
(
"msg"
)
error
=
kwargs
.
get
(
"error"
,
""
)
error
=
kwargs
.
get
(
"error"
,
""
)
list_url
=
kwargs
.
get
(
"list_url"
,
None
)
list_url
=
kwargs
.
get
(
"list_url"
,
self
.
get_routes
()
)
if
msg
:
if
msg
:
self
.
ses
.
flash
(
msg
,
error
)
self
.
ses
.
flash
(
msg
,
error
)
if
not
list_url
:
if
not
list_url
:
list_url
=
self
.
req
.
route_url
(
self
.
list_route
)
list_url
=
self
.
req
.
route_url
(
self
.
list_route
,
**
kwargs
)
log
.
error
(
list_url
)
log
.
error
(
list_url
)
if
self
.
headers
:
if
self
.
headers
:
return
HTTPFound
(
location
=
get_urls
(
list_url
),
return
HTTPFound
(
location
=
get_urls
(
list_url
),
...
@@ -295,13 +301,13 @@ class BaseView(object):
...
@@ -295,13 +301,13 @@ class BaseView(object):
if
not
new_buttons
:
if
not
new_buttons
:
new_buttons
=
self
.
new_buttons
new_buttons
=
self
.
new_buttons
if
not
list_url
and
self
.
list_route
:
if
not
list_url
and
self
.
list_route
:
list_url
=
self
.
req
.
route_url
(
self
.
list_route
)
list_url
=
self
.
req
.
route_url
(
self
.
list_route
)
else
:
else
:
list_url
=
list_url
and
list_url
[
0
:
1
]
!=
"/"
and
"/"
+
\
if
list_url
[:
4
]
!=
'http'
:
list_url
or
list_url
list_url
=
f
"/{list_url}"
.
replace
(
"//"
,
"/"
)
list_url
=
self
.
home
+
list_url
list_url
=
self
.
home
+
list_url
table
=
DeTable
(
schema
,
table
=
DeTable
(
schema
,
action
=
list_url
,
action
=
list_url
,
...
...
opensipkd/detable/detable.py
View file @
4f3d6d3
...
@@ -144,9 +144,11 @@ class DeTable(field.Field):
...
@@ -144,9 +144,11 @@ class DeTable(field.Field):
new_buttons
=
kw
.
get
(
"new_buttons"
)
or
{}
new_buttons
=
kw
.
get
(
"new_buttons"
)
or
{}
action_suffix
=
f
"{action_suffix}{params}"
action_suffix
=
f
"{action_suffix}{params}"
close_url
=
self
.
action
.
split
(
"/"
)
close_url
=
self
.
action
close_url
=
"/"
.
join
(
close_url
[:
-
1
])
if
close_url
[:
4
]
!=
"http"
:
close_url
.
replace
(
":/"
,
"://"
)
close_url
=
self
.
action
.
split
(
"/"
)
close_url
=
"/"
.
join
(
close_url
[:
-
1
])
close_url
.
replace
(
":/"
,
"://"
)
params
=
params
and
f
"?{params}"
or
""
params
=
params
and
f
"?{params}"
or
""
dict_buttons
=
{
dict_buttons
=
{
"close"
:
"{window.location = '"
+
close_url
+
"'; return false;}"
,
"close"
:
"{window.location = '"
+
close_url
+
"'; return false;}"
,
...
...
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