Now it sorts articles correctly on update.

This commit is contained in:
maste9 2015-03-07 00:04:30 +01:00 committed by Homer S
parent 6e0226028d
commit 78d2ccdbc6
1 changed files with 3 additions and 3 deletions

View File

@ -182,10 +182,10 @@ def join_articles():
# Bring articles into chronological order
t = time.mktime(time.strptime(article['DATE'] + " " + article['TIME'],"%m/%d/%y %H:%M:%S"))
articles_dict[str(t)] = article
dates_of_creation = [value for value in articles_dict.keys()]
print(dates_of_creation)
dates_of_creation = [float(value) for value in articles_dict.keys()]
dates_of_creation.sort(key=None,reverse=True)
for date in dates_of_creation:
joined_html += article_to_html(articles_dict[str(time.strftime(date))])
joined_html += article_to_html(articles_dict[str(time.strftime(str(date)))])
return joined_html