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
eef9be26
Commit
eef9be26
authored
May 03, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX ERGO] Corpora ordered by name.
parent
8a0bb9e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
nodes.py
gargantext/models/nodes.py
+4
-1
projects.py
gargantext/views/pages/projects.py
+1
-1
No files found.
gargantext/models/nodes.py
View file @
eef9be26
...
...
@@ -101,13 +101,16 @@ class Node(Base):
# session.add(self)
# session.commit()
def
children
(
self
,
typename
=
None
):
def
children
(
self
,
typename
=
None
,
order
=
None
):
"""Return a query to all the direct children of the current node.
Allows filtering by typename (see `constants.py`)
"""
query
=
session
.
query
(
Node
)
.
filter
(
Node
.
parent_id
==
self
.
id
)
if
typename
is
not
None
:
query
=
query
.
filter
(
Node
.
typename
==
typename
)
if
order
is
not
None
:
query
=
query
.
order_by
(
Node
.
name
)
return
query
def
add_child
(
self
,
**
kwargs
):
...
...
gargantext/views/pages/projects.py
View file @
eef9be26
...
...
@@ -110,7 +110,7 @@ def project(request, project_id):
# corpora within this project
corpora
=
project
.
children
(
'CORPUS'
)
.
all
()
corpora
=
project
.
children
(
'CORPUS'
,
order
=
True
)
.
all
()
sourcename2corpora
=
defaultdict
(
list
)
for
corpus
in
corpora
:
# we only consider the first resource of the corpus to determine its type
...
...
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