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
b01358ca
Commit
b01358ca
authored
Jan 12, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] Commenting useless code.
parent
bba2a8eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
35 deletions
+35
-35
views.py
gargantext_web/views.py
+35
-35
No files found.
gargantext_web/views.py
View file @
b01358ca
...
@@ -340,41 +340,41 @@ def corpus(request, project_id, corpus_id):
...
@@ -340,41 +340,41 @@ def corpus(request, project_id, corpus_id):
# except:
# except:
# sources_donut = []
# sources_donut = []
# Do a javascript query/api for that
# Do a javascript query/api for that
query_date
=
"""
#
query_date = """
SELECT
#
SELECT
id,
#
id,
metadata -> 'publication_year' as year,
#
metadata -> 'publication_year' as year,
metadata -> 'publication_month' as month,
#
metadata -> 'publication_month' as month,
metadata -> 'publication_day' as day,
#
metadata -> 'publication_day' as day,
metadata -> 'title'
#
metadata -> 'title'
FROM
#
FROM
node_node AS n
#
node_node AS n
WHERE
#
WHERE
n.parent_id =
%
d
#
n.parent_id = %d
ORDER BY
#
ORDER BY
year, month, day DESC
#
year, month, day DESC
LIMIT
#
LIMIT
20
#
20
OFFSET
#
OFFSET
%
d
#
%d
"""
%
(
corpus
.
id
,
0
)
#
""" % (corpus.id, 0)
try
:
#
try:
cursor
=
connection
.
cursor
()
#
cursor = connection.cursor()
#
cursor
.
execute
(
query_date
)
#
cursor.execute(query_date)
documents
=
list
()
#
documents = list()
while
True
:
#
while True:
document
=
dict
()
#
document = dict()
row
=
cursor
.
fetchone
()
#
row = cursor.fetchone()
#
if
row
is
None
:
#
if row is None:
break
#
break
document
[
'id'
]
=
row
[
0
]
#
document['id'] = row[0]
document
[
'date'
]
=
row
[
1
]
+
'/'
+
row
[
2
]
+
'/'
+
row
[
3
]
#
document['date'] = row[1] + '/' + row[2] + '/' + row[3]
document
[
'title'
]
=
row
[
4
]
#
document['title'] = row[4]
documents
.
append
(
document
)
#
documents.append(document)
except
Exception
as
error
:
#
except Exception as error:
print
(
error
)
#
print(error)
try
:
try
:
chart
=
dict
()
chart
=
dict
()
...
...
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