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
797bb59b
Commit
797bb59b
authored
Jan 14, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'samuel' into unstable
parents
7902f2bc
c2bd2ced
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
models.py
node/models.py
+13
-13
subcorpus.html
templates/subcorpus.html
+3
-3
No files found.
node/models.py
View file @
797bb59b
...
...
@@ -130,19 +130,19 @@ class Node(CTENode):
def
add_resource
(
self
,
**
kwargs
):
print
(
"printing arguments for add_resource():"
)
print
(
kwargs
)
from
django.core.files.storage
import
default_storage
from
django.core.files.base
import
ContentFile
import
os
thefile
=
kwargs
[
"file"
]
path
=
default_storage
.
save
(
'tmp/somename.zip'
,
ContentFile
(
thefile
.
read
()))
tmp_file
=
os
.
path
.
join
(
MEDIA_ROOT
,
path
)
print
(
tmp_file
)
kwargs
[
"file"
]
=
tmp_file
print
(
"final kwargs:"
)
print
(
kwargs
)
#
print("printing arguments for add_resource():")
#
print(kwargs)
#
from django.core.files.storage import default_storage
#
from django.core.files.base import ContentFile
#
import os
#
thefile = kwargs["file"]
#
path = default_storage.save('tmp/somename.zip', ContentFile(thefile.read()))
#
tmp_file = os.path.join(MEDIA_ROOT, path)
#
print(tmp_file)
#
kwargs["file"] = tmp_file
#
print("final kwargs:")
#
print(kwargs)
# only for tests
...
...
templates/subcorpus.html
View file @
797bb59b
...
...
@@ -3,15 +3,15 @@
<div
class=
"pagination"
>
<span
class=
"step-links"
>
{% if documents.has_previous %}
<a
onclick=
"updateDocuments({{ documents.previous_page_number }},true);"
>
previous
</a>
<a
style=
"cursor: pointer;"
onclick=
"updateDocuments({{ documents.previous_page_number }},true);"
>
previous
</a>
{% endif %}
<span
class=
"current"
>
Page {{ documents.number }}
of {{ documents.paginator.num_pages }}.
<strong>
Page {{ documents.number }}
</strong>
of {{ documents.paginator.num_pages }}.
</span>
{% if documents.has_next %}
<a
onclick=
"updateDocuments({{ documents.next_page_number }},true);"
>
next
</a>
<a
style=
"cursor: pointer;"
onclick=
"updateDocuments({{ documents.next_page_number }},true);"
>
next
</a>
{% endif %}
</span>
</div>
...
...
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