提交评论功能

This commit is contained in:
2024-05-06 12:35:09 +08:00
parent 645aafcadb
commit e48d34c52c
10 changed files with 215 additions and 8 deletions
+9 -1
View File
@@ -1,7 +1,7 @@
import json
from django.shortcuts import render
from server.models import Task,StudentandTercher
from server.models import Task,StudentandTercher,Comment
from server_auth.models import MindUser
@@ -21,6 +21,14 @@ def to_baiban(request):
"path": test_date}
return render(request, "html/baiban.html", param)
def to_pinglun(request):
test_date = request.GET.get('id')
comment_list = Comment.objects.filter(pinglun_id=test_date) # 从数据库找出该文章的评论数据对象
param = {"path": test_date,
"comment_list": comment_list}
print(test_date)
return render(request, "html/commont.html", param)
def to_share(request):
"""
分享页面