Commit ff3668d3 by liuyingying

更改读取最新动态的方式

parent 244a9cb6
......@@ -103,6 +103,14 @@ def index_html(request):
cve.author = cve.owner
cve.date = str(cve.datetime)[5:10]
# 读取最新论文4篇;文章2篇;CVE2条
if newest_publication.count() < 1:
newest_publication = Publications.objects.all().order_by('-editDateTime')[:4]
if newest_article.count() < 1:
newest_article = Articles.objects.all().order_by('-editDateTime')[:2]
if newest_cve.count() < 1:
newest_cve = Bugs.objects.all().order_by('-datetime')[:2]
newest_post_list['publication'] = newest_publication
newest_post_list['article'] = newest_article
newest_post_list['cve'] = newest_cve
......
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