Commit b01358ca authored by Administrator's avatar Administrator

[CLEAN] Commenting useless code.

parent bba2a8eb
...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment