From c87076d495ee9cb25b5e0f272b507053876869fd Mon Sep 17 00:00:00 2001 From: baoliang Date: Sat, 26 Sep 2020 18:22:59 +0800 Subject: [PATCH] add message --- polls/templates/polls/monitor_result.html | 56 ++++++++++++++++++ polls/templates/polls/monitor_statistics.html | 2 +- polls/urls.py | 2 + polls/views/__init__.py | 2 +- .../views/__pycache__/__init__.cpython-38.pyc | Bin 1065 -> 1090 bytes .../views/__pycache__/monitor.cpython-38.pyc | Bin 2604 -> 2748 bytes polls/views/__pycache__/task.cpython-38.pyc | Bin 2696 -> 2743 bytes polls/views/monitor.py | 4 ++ polls/views/task.py | 5 +- 9 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 polls/templates/polls/monitor_result.html diff --git a/polls/templates/polls/monitor_result.html b/polls/templates/polls/monitor_result.html new file mode 100644 index 0000000..2517a33 --- /dev/null +++ b/polls/templates/polls/monitor_result.html @@ -0,0 +1,56 @@ +{% extends 'polls/base.html' %} +{% load static %} +{% block content%} +
+
+
+
+
+
+
+{% endblock%} +{% block add_js %} + + +{% endblock %} \ No newline at end of file diff --git a/polls/templates/polls/monitor_statistics.html b/polls/templates/polls/monitor_statistics.html index c7a3e1e..3f40208 100644 --- a/polls/templates/polls/monitor_statistics.html +++ b/polls/templates/polls/monitor_statistics.html @@ -55,7 +55,7 @@ var option2 = { title: { text: '政务新媒体区域分布', - subtext: '省直部门:{{total1}},市直部门:{{total2}},县区政府:{{total3}}', + subtext: '省直部门{{total1}},市直部门{{total2}},县区政府{{total3}}', subtextStyle: { fontSize: 16, }, diff --git a/polls/urls.py b/polls/urls.py index a84a08c..954be7c 100644 --- a/polls/urls.py +++ b/polls/urls.py @@ -30,6 +30,8 @@ urlpatterns = [ views.news_detail, name='polls_news_detail'), path('monitor/statistics/', views.monitor_statistics, name='polls_monitor_statistics'), + path('monitor/result/', views.monitor_result, + name='polls_monitor_result'), path('tasks/list/', views.tasks, name='polls_tasks_list'), path('tasks/create/', views.create_task, name='polls_tasks_create'), path('tasks/create_test/', views.create_test_task, diff --git a/polls/views/__init__.py b/polls/views/__init__.py index e621b8f..d1468be 100644 --- a/polls/views/__init__.py +++ b/polls/views/__init__.py @@ -2,7 +2,7 @@ from .user import index, status_500, status_401, polls_login, send_code, registe from .notice import notices, notice_top, read_notice, reply_notice from .media import medias, my_medias, create_media, update_media, media_detail from .news import news_list, news_top, news_detail -from .monitor import monitor_statistics +from .monitor import monitor_statistics, monitor_result from .task import tasks, create_task, create_test_task from .group import groups, room from .compartment import compartments diff --git a/polls/views/__pycache__/__init__.cpython-38.pyc b/polls/views/__pycache__/__init__.cpython-38.pyc index 19a7d066171740c2209e56a760e84b6975fc22aa..aa0d13a5aba42f2e4c3c4e997cc33f1fdc79204b 100644 GIT binary patch delta 254 zcmZ3*+r5-W|0(#kOm2| zrWfUx78J>V1Z06k6nAodZb4#ENp5OhNs$~#SRSN~JvX(uI59o7NC70I2qacA6lsCj TT9Y?0=W_`#iZBW=@&F+KYR5gp delta 244 zcmX@av66!~l$V!_0SMN;%ZtyM$SccuVWM`U4u#Q zmgE=37ndZKWEPiXCKpeRWU6P>n0%9IQsga`lEmWdA_<^NiX=gV6p*;ZnqHJ&T2Len z5|9BBQQXP-xdn+uCAq12B}K9zVL6aG_T1Fs;>7gSB6*OI0+3kAP^1ZBYfe7NoX^F> LD8eYf$OD7`rE)$N diff --git a/polls/views/__pycache__/monitor.cpython-38.pyc b/polls/views/__pycache__/monitor.cpython-38.pyc index b6273dd8aee442edf9e7750f8755e5f2c48cd289..cd9aa1cdf28daf20813aaa3017d15307a0c11549 100644 GIT binary patch delta 448 zcmZ1@vPYCRl$V!_0SKD-^W&FKHlp@i>5XF}w8O)$5^%5k#a^sRStc*O9 z3)y6Z`GI^*##@|urMdCBsVSL>MFNu-u*os3Bk?!UY z4pGK>eIPHH5lFxQh|LVd&OlrY@5>&1T}sK zEzZ2s-1ywol+45;{>dxY|O@79%!6pRK zB{*4xLr+Q=q>C}TNCYG#3L?aS#7c%Doy{>EqKx%=K%So_-z|ZZti-(Ze7)j~{GyWN z(vspLCZJ4|KuTh9MpAxaQHow}eoAUiaS=1f3>FXpb{p80AWwiD4L2qw38o(8>>^ND m6)AuSkbOlua6%Hy)CKZyao7NDD9uT=V+8VwH756SX#)V2URKut diff --git a/polls/views/__pycache__/task.cpython-38.pyc b/polls/views/__pycache__/task.cpython-38.pyc index 1293b6d8b01495926c2b5810bb30eac28885c308..fbf8548e69712fd4d6aa54f19146335fdd0ce0d4 100644 GIT binary patch delta 674 zcmYjN%Wl&^6!jh3<458oh(=A)D6K$F$s#E!w5U-RNK`yhfrMIAfrKKHnUsg?gt1u^ zxhpno%4W78B}>?aF8Bn#0Wa7i@d+%Lv4x5k$M@WO=A1k8zWlB1JaQac5#LXHJoqtp zegpcd@U~XtWwZo7@1ojhYR!}#CqN9Xc^%Jk7=C3_y9kALCdj#HL*R3y1rCHaqtIHYij_LNqUe?q-Gi7^}p5e=fZ7u?5f z_o(fX758q>z29^965S(&lEet#42LufKO?pv7Eg>LLA*nHy9J3BdL!B@@jqy*ny8-d zv!aw>Z!)0)VHH7GmG7wcpu<0?54)?PAr;{z0g7sa4JH&o6Np8viMjxJ!E7jrKU+O3 zXa}IDMm*3PHMS(qu|)wbl-NT?y@-;*vtw4_bA9c~H8J=Fa;maTsk|ZKy6mF=yWGU< zI2Ba*O}u%L)#S9y8d9!GSmvjA3s(4de9&&D4FQQUVdK#YpJq3cYh*DpH;rK%eAl>D z??|4)nmm@v79B)h_{!y9i~;nyZF+E(`(|fxTZ-!v?~CW7XAiyJTb5!F)=Xn&Jik>?sNCP@7?>plRuZ=l)ZJ&b2a?<@2LOw z(EA1CgC<8tRhG#dY{@36KDeW8)+Scsq!u$7-65~Y#7^mfo7x`%v=^%>O-*L4XsPk6 za8P8ZV(eh7V~v^Dv=T4Xnac|A$eI=u6Dyxg@xQQDIO{J3mRk=)CG%u*jnBJ;nR{U}>!0tg=RMiz-VNQObZK%mVbfa-T z7Z8~>7NhN_LoVt{Qlm_*ly`0=T5{jIT?uJWg_lo?Ld$K<{YX dap0W#1){6aQ#c-M+CWa+rgM@2f#L-Me*rK5i=6-f diff --git a/polls/views/monitor.py b/polls/views/monitor.py index 08d6f9e..54b05b6 100644 --- a/polls/views/monitor.py +++ b/polls/views/monitor.py @@ -104,3 +104,7 @@ def monitor_statistics(request): total3 = NewMedia.category_three_count() return render(request, 'polls/monitor_statistics.html', {'chart1_data': chart1_data, 'total': total, 'chart2_data': chart2_data, 'total1': total1, 'total2': total2, 'total3': total3}) + + +def monitor_result(request): + return render(request, 'polls/monitor_result.html') \ No newline at end of file diff --git a/polls/views/task.py b/polls/views/task.py index 87e8964..38da068 100644 --- a/polls/views/task.py +++ b/polls/views/task.py @@ -24,13 +24,14 @@ def tasks(request): result = dict() result['id'] = o.id m = [] - for g in o.groups: + for g in o.groups.all(): n = model_to_dict(g, ['id', 'name']) m.append(n) result['groups'] = m + result['content'] = o.content result['added'] = o.added.strftime("%Y-%m-%d %H:%M:%S") results.append(result) - return JsonResponse(results, safe=False) + return JsonResponse({'status': 'success', 'message':results}, safe=False) @csrf_exempt