diff --git a/NewMediaMonitoring/urls.py b/NewMediaMonitoring/urls.py index e71499b..46f8857 100644 --- a/NewMediaMonitoring/urls.py +++ b/NewMediaMonitoring/urls.py @@ -14,7 +14,7 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path, re_path, include +from django.urls import path, include from django.conf import settings from django.conf.urls.static import static # from wagtail.admin import urls as wagtailadmin_urls diff --git a/dashboard/models.py b/dashboard/models.py index e489b0a..ffebcf4 100644 --- a/dashboard/models.py +++ b/dashboard/models.py @@ -26,18 +26,14 @@ class Group_type(models.Model): class Group(models.Model): - GROUP_STATUS_CHOICES = ( - ('0', '关闭'), - ('1', '开启') - ) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) name = models.CharField('矩阵名称', max_length=256, null=True, blank=True) presentation = models.TextField('矩阵描述', null=True, blank=True) image = models.FileField(upload_to='groupimage', null=True, blank=True) type = models.ForeignKey( Group_type, on_delete=models.CASCADE, null=True, blank=True) - status = models.CharField( - '状态', max_length=256, null=True, blank=True, choices=GROUP_STATUS_CHOICES) + status = models.IntegerField( + '状态', null=True, blank=True,default=0) province = models.CharField('省', max_length=256, null=True, blank=True) cities = models.CharField('市', max_length=256, null=True, blank=True) district = models.CharField('县', max_length=256, null=True, blank=True) @@ -109,7 +105,7 @@ class Organization(models.Model): village = models.CharField('村', max_length=256, null=True, blank=True) level = models.ForeignKey( Level, on_delete=models.CASCADE, null=True, blank=True) - directly = models.CharField('直属', max_length=256, null=True, blank=True) + directly = models.CharField('单位类型', max_length=256, null=True, blank=True) created = models.DateTimeField('创建时间', auto_now_add=True) updated = models.DateTimeField('更新时间', auto_now=True) @@ -149,10 +145,6 @@ def create_user_profile(sender, instance, created, **kwargs): class NewMedia(models.Model): - NEWMEDIA_STATUS_CHOICES = ( - ('1', '开启'), - ('0', '关闭') - ) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) code = models.CharField('微信公众号', max_length=256, null=True, blank=True) alias = models.CharField('别名', max_length=256, null=True, blank=True) @@ -160,8 +152,8 @@ class NewMedia(models.Model): upload_to='cover/%Y/%m/%d/', null=True, blank=True) organization = models.ForeignKey( Organization, on_delete=models.CASCADE, null=True, blank=True) - status = models.CharField( - '状态', max_length=256, null=True, blank=True, choices=NEWMEDIA_STATUS_CHOICES) + status = models.IntegerField( + '状态',null=True, blank=True,default=0) attention = models.CharField('关注量', null=True, blank=True, max_length=256) remark = models.CharField('备注', null=True, blank=True, max_length=2560) created = models.DateTimeField('创建时间', auto_now_add=True) @@ -554,7 +546,9 @@ class News(models.Model): ('1', '基层动态'), ('2', '外省动态'), ('3', '监测通报'), - ('4', '舆情热点') + ('4', '舆情热点'), + ('5', '通知'), + ('6', '重点新闻'), ) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) type = models.CharField('文章类型', max_length=256, null=True, diff --git a/management/templates/management/news-management-create.html b/management/templates/management/news-management-create.html index 912d5e6..440fc1d 100644 --- a/management/templates/management/news-management-create.html +++ b/management/templates/management/news-management-create.html @@ -62,7 +62,7 @@