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 74ba6c88
authored
Aug 25, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add query_id method to ApiViews for enhanced ID-based querying
1 parent
44fc7cff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
opensipkd/base/views/api_base.py
opensipkd/base/views/api_base.py
View file @
74ba6c8
...
...
@@ -94,6 +94,18 @@ class ApiViews:
return
query
def
query_id
(
self
,
**
kw
):
table
=
kw
.
get
(
"table"
,
self
.
table
)
orders
=
kw
.
get
(
"orders"
,
self
.
get_orders
)
if
hasattr
(
table
,
"query_id"
)
and
self
.
id
:
query
=
table
.
query_id
(
self
.
id
)
query
=
orders
(
query
,
table
=
table
)
query
=
query
.
limit
(
self
.
psize
)
.
offset
(
(
self
.
page
-
1
)
*
self
.
psize
)
return
query
return
self
.
query
(
**
kw
)
def
success
(
self
,
data
=
[],
msg
=
None
):
if
type
(
data
)
is
not
list
:
data
=
[
data
]
...
...
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