Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
c6cb7d74
Commit
c6cb7d74
authored
Nov 02, 2020
by
Andrey Vertiprahov
Browse files
Add api_unlimited_row_limit param to extapplication limit query.
parent
a6e1da7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/app/extapplication.py
View file @
c6cb7d74
...
...
@@ -55,6 +55,7 @@ class ExtApplication(Application):
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
document_root
=
os
.
path
.
join
(
"services"
,
"web"
,
"apps"
,
self
.
module
,
self
.
app
)
self
.
row_limit
=
config
.
web
.
api_row_limit
self
.
unlimited_row_limit
=
config
.
web
.
api_unlimited_row_limit
self
.
pk
=
"id"
# Bulk fields API
self
.
bulk_fields
=
[]
...
...
@@ -149,7 +150,8 @@ class ExtApplication(Application):
q
=
{
str
(
k
):
v
[
0
]
if
len
(
v
)
==
1
else
v
for
k
,
v
in
request
.
POST
.
lists
()}
else
:
q
=
{
str
(
k
):
v
[
0
]
if
len
(
v
)
==
1
else
v
for
k
,
v
in
request
.
GET
.
lists
()}
limit
=
q
.
get
(
self
.
limit_param
)
# Apply row limit if necessary
limit
=
q
.
get
(
self
.
limit_param
,
self
.
unlimited_row_limit
)
if
limit
:
try
:
limit
=
max
(
int
(
limit
),
0
)
...
...
@@ -222,9 +224,6 @@ class ExtApplication(Application):
ordering
=
ordering
or
self
.
default_ordering
if
ordering
:
data
=
data
.
order_by
(
*
ordering
)
# Apply row limit if necessary
if
self
.
row_limit
:
limit
=
min
(
limit
or
self
.
row_limit
,
self
.
row_limit
+
1
)
# Apply paging
if
limit
:
data
=
data
[
start
:
start
+
limit
]
...
...
Dmitry Volodin
@dv
mentioned in commit
1f006ca8
·
Nov 03, 2020
mentioned in commit
1f006ca8
mentioned in commit 1f006ca8e2d14ead164a344142d9a45cacbc24bc
Toggle commit list
Andrey Vertiprahov
@aversant
mentioned in merge request
!4577 (merged)
·
Nov 03, 2020
mentioned in merge request
!4577 (merged)
mentioned in merge request !4577
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
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 comment