Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
637d6208
Commit
637d6208
authored
Sep 13, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: set default number of publications shown from constants.py instead of hardcoded limit at 5
parent
8079ad7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
constants.py
gargantext/constants.py
+5
-0
nodes.py
gargantext/views/api/nodes.py
+2
-2
No files found.
gargantext/constants.py
View file @
637d6208
...
...
@@ -351,6 +351,11 @@ QUERY_SIZE_N_MAX = 1000
QUERY_SIZE_N_DEFAULT
=
1000
# ------------------------------------------------------------------------------
# Graph <=> nodes API parameters
# number of relevant publications shown
DEFAULT_N_DOCS_HAVING_NGRAM
=
5
# ------------------------------------------------------------------------------
# Graph constraints to compute the graph:
# Modes: live graph generation, graph asynchronously computed or errors detected
...
...
gargantext/views/api/nodes.py
View file @
637d6208
from
gargantext.models
import
Node
,
Ngram
,
NodeNgram
,
NodeNodeNgram
,
NodeNode
from
gargantext.constants
import
NODETYPES
from
gargantext.constants
import
NODETYPES
,
DEFAULT_N_DOCS_HAVING_NGRAM
from
gargantext.util.db
import
session
,
delete
,
func
,
bulk_insert
from
gargantext.util.db_cache
import
cache
,
or_
from
gargantext.util.validation
import
validate
...
...
@@ -155,7 +155,7 @@ class NodeListHaving(APIView):
except
:
raise
ValidationException
(
'"ngram_ids" needs integers separated by comma.'
)
limit
=
5
limit
=
DEFAULT_N_DOCS_HAVING_NGRAM
nodes_list
=
[]
corpus
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
corpus_id
)
.
first
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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