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
a73dfab2
Commit
a73dfab2
authored
Jun 30, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a django custom command callable with manage.py
Call it with: ./manage nodes show
parent
85e2d95a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
__init__.py
gargantext/management/__init__.py
+0
-0
__init__.py
gargantext/management/commands/__init__.py
+0
-0
nodes.py
gargantext/management/commands/nodes.py
+18
-0
something.py
gargantext/management/commands/something.py
+9
-0
No files found.
gargantext/management/__init__.py
0 → 100644
View file @
a73dfab2
gargantext/management/commands/__init__.py
0 → 100644
View file @
a73dfab2
gargantext/management/commands/nodes.py
0 → 100644
View file @
a73dfab2
from
django.core.management.base
import
BaseCommand
,
CommandError
from
gargantext.tools.show_nodes
import
tree_show
,
nodes
import
colorama
class
Command
(
BaseCommand
):
help
=
'Nodes'
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
dest
=
'action'
,
default
=
'show'
)
def
handle
(
self
,
*
args
,
**
options
):
action
=
options
.
get
(
'action'
)
if
action
==
'show'
:
colorama
.
init
(
strip
=
False
)
for
root
in
nodes
():
tree_show
(
root
)
gargantext/management/commands/something.py
0 → 100644
View file @
a73dfab2
from
django.core.management.base
import
BaseCommand
,
CommandError
from
gargantext.models
import
Node
class
Command
(
BaseCommand
):
help
=
'Something'
def
handle
(
self
,
*
args
,
**
options
):
self
.
stdout
.
write
(
self
.
style
.
SUCCESS
(
'Oh yeah!'
))
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