From 8ba64b0973c56c1b0af7aedc0dba26ce61434424 Mon Sep 17 00:00:00 2001 From: baoliang Date: Mon, 1 Feb 2021 21:55:32 +0800 Subject: [PATCH] add unqualified media --- polls/models.py | 26 ++++++++- .../polls/monitor_unqualified_result.html | 56 +++++++++++++++++++ polls/views/monitor.py | 7 ++- 3 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 polls/templates/polls/monitor_unqualified_result.html diff --git a/polls/models.py b/polls/models.py index 1284ea7..68fb71f 100644 --- a/polls/models.py +++ b/polls/models.py @@ -4,7 +4,7 @@ import datetime from django.contrib.auth.models import User from django.db import models -from dashboard.models import Group, Group_user +from dashboard.models import Group, Group_user, NewMedia VERIFY_CODE_TYPE_CHOICES = ( (0, 'register'), @@ -239,4 +239,26 @@ class VoiceNotifyRecord(models.Model): phone = models.CharField('phone', max_length=32) added = models.DateField(auto_now_add=True) notice_id = models.CharField('notice_id', max_length=64) - updated = models.DateTimeField(auto_now=True) \ No newline at end of file + updated = models.DateTimeField(auto_now=True) + + +UNQUALIFIED_MEDIA_TYPE_CHOICES = ( + (0, 'weixin'), + (1, 'weibo'), + (2, 'toutiao'), + (3, 'douyin'), + (4, 'qita') +) + + +class UnqualifiedMedia(models.Model): + id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) + media = models.ForeignKey(NewMedia, on_delete=models.CASCADE) + result = models.TextField('result', null=True, blank=True) + cou = models.IntegerField('count of update', default=0) + dos = models.IntegerField('days of silent', default=0) + sdos = models.DateField('start date of silent', null=True, blank=True) + edos = models.DateField('end date of silent', null=True, blank=True) + version = models.IntegerField('version', default=0) + added = models.DateField(auto_now_add=True) + updated = models.DateTimeField(auto_now=True) diff --git a/polls/templates/polls/monitor_unqualified_result.html b/polls/templates/polls/monitor_unqualified_result.html new file mode 100644 index 0000000..2517a33 --- /dev/null +++ b/polls/templates/polls/monitor_unqualified_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/views/monitor.py b/polls/views/monitor.py index faef8d7..c8ad3f2 100644 --- a/polls/views/monitor.py +++ b/polls/views/monitor.py @@ -34,7 +34,6 @@ def monitor_statistics(request): chart4_data.append({'name': '激活', 'value': profile_status_1_count}) chart4_data.append({'name': '未激活', 'value': profile_status_0_count}) - wbc = Weibo.objects.exclude(status=0).count() wxc = Weixin.objects.exclude(status=0).count() ttc = Toutiao.objects.exclude(status=0).count() @@ -141,3 +140,9 @@ def city_ranking(request): def monitor_result(request): return render(request, 'polls/monitor_result.html') + + +def monitor_unqualified_result(request): + user_id = request.user.id + + return render(request, 'polls/monitor_unqualified_result.html')