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
a63eb3f6
Commit
a63eb3f6
authored
Oct 16, 2014
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test django-cte-trees: ok on prend
parent
335cf638
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
627 additions
and
250 deletions
+627
-250
test_nodes-checkpoint.ipynb
.ipynb_checkpoints/test_nodes-checkpoint.ipynb
+286
-226
models.py
node/models.py
+24
-0
test_nodes.ipynb
test_nodes.ipynb
+317
-24
No files found.
.ipynb_checkpoints/test_nodes-checkpoint.ipynb
View file @
a63eb3f6
This diff is collapsed.
Click to expand it.
node/models.py
View file @
a63eb3f6
...
...
@@ -3,7 +3,9 @@ from django.utils import timezone
from
django.contrib.auth.models
import
User
from
django_hstore
import
hstore
from
treebeard.mp_tree
import
MP_Node
from
cte_tree.models
import
CTENode
from
time
import
time
...
...
@@ -42,6 +44,28 @@ class Node(MP_Node):
for
noeud
in
Node
.
objects
.
filter
(
user
=
user
):
print
(
noeud
.
depth
*
" "
+
"[
%
d]
%
d"
%
(
noeud
.
pk
,
noeud
.
name
))
class
Nodec
(
CTENode
):
user
=
models
.
ForeignKey
(
User
)
type
=
models
.
ForeignKey
(
NodeType
)
name
=
models
.
CharField
(
max_length
=
200
)
date
=
models
.
DateField
(
default
=
timezone
.
now
(),
blank
=
True
)
metadata
=
hstore
.
DictionaryField
(
blank
=
True
)
# the 'file' column should be deprecated soon;
# use resources instead.
file
=
models
.
FileField
(
upload_to
=
upload_to
,
blank
=
True
)
#resources = models.ManyToManyField(Resource)
#objects = hstore.HStoreManager()
def
__str__
(
self
):
return
self
.
name
def
liste
(
self
,
user
):
for
noeud
in
Node
.
objects
.
filter
(
user
=
user
):
print
(
noeud
.
depth
*
" "
+
"[
%
d]
%
d"
%
(
noeud
.
pk
,
noeud
.
name
))
class
Project
(
Node
):
class
Meta
:
proxy
=
True
...
...
test_nodes.ipynb
View file @
a63eb3f6
This diff is collapsed.
Click to expand it.
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