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
88a82af8
Commit
88a82af8
authored
Jul 23, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] if Time follows Rfc3339
parent
119e39bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
views.py
gargantext_web/views.py
+8
-4
No files found.
gargantext_web/views.py
View file @
88a82af8
...
@@ -252,7 +252,7 @@ def projects(request):
...
@@ -252,7 +252,7 @@ def projects(request):
})
})
def
update_nodes
(
request
,
project_id
,
corpus_id
,
view
):
def
update_nodes
(
request
,
project_id
,
corpus_id
,
view
=
None
):
'''
'''
update function:
update function:
- remove previous computations (temporary lists and coocurrences)
- remove previous computations (temporary lists and coocurrences)
...
@@ -265,7 +265,8 @@ def update_nodes(request, project_id, corpus_id, view):
...
@@ -265,7 +265,8 @@ def update_nodes(request, project_id, corpus_id, view):
try
:
try
:
offset
=
int
(
project_id
)
offset
=
int
(
project_id
)
offset
=
int
(
corpus_id
)
offset
=
int
(
corpus_id
)
offset
=
str
(
view
)
if
view
is
not
None
:
offset
=
str
(
view
)
except
ValueError
:
except
ValueError
:
raise
Http404
()
raise
Http404
()
...
@@ -307,7 +308,10 @@ def update_nodes(request, project_id, corpus_id, view):
...
@@ -307,7 +308,10 @@ def update_nodes(request, project_id, corpus_id, view):
#return redirect(request.path.replace('update', ''))
#return redirect(request.path.replace('update', ''))
return
redirect
(
'/project/
%
s/corpus/
%
s/
%
s'
%
(
project_id
,
corpus_id
,
view
))
if
view
is
None
:
return
redirect
(
'/project/
%
s/corpus/
%
s/'
%
(
project_id
,
corpus_id
))
else
:
return
redirect
(
'/project/
%
s/corpus/
%
s/
%
s'
%
(
project_id
,
corpus_id
,
view
))
#
#
# return render_to_response(
# return render_to_response(
# request.path,
# request.path,
...
@@ -385,7 +389,7 @@ def newpaginatorJSON(request , corpus_id):
...
@@ -385,7 +389,7 @@ def newpaginatorJSON(request , corpus_id):
for
doc
in
documents
:
for
doc
in
documents
:
if
"publication_date"
in
doc
.
hyperdata
:
if
"publication_date"
in
doc
.
hyperdata
:
try
:
try
:
realdate
=
doc
.
hyperdata
[
"publication_date"
]
.
split
(
" "
)[
0
]
# in database is = (year-month-day = 2015-01-06 00:00:00 = 06 jan 2015 00 hrs)
realdate
=
doc
.
hyperdata
[
"publication_date"
]
.
replace
(
'T'
,
' '
)
.
split
(
" "
)[
0
]
# in database is = (year-month-day = 2015-01-06 00:00:00 = 06 jan 2015 00 hrs)
realdate
=
datetime
.
datetime
.
strptime
(
str
(
realdate
),
'
%
Y-
%
m-
%
d'
)
.
date
()
# finalform = (yearmonthday = 20150106 = 06 jan 2015)
realdate
=
datetime
.
datetime
.
strptime
(
str
(
realdate
),
'
%
Y-
%
m-
%
d'
)
.
date
()
# finalform = (yearmonthday = 20150106 = 06 jan 2015)
# doc.date = realdate
# doc.date = realdate
resdict
=
{}
resdict
=
{}
...
...
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