From 694a011de1efbff663cb7afbc185284e9adfd49d Mon Sep 17 00:00:00 2001 From: xieshen <1397910458@qq.com> Date: Wed, 21 Oct 2020 11:50:20 +0800 Subject: [PATCH] =?UTF-8?q?#=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- management/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/management/views.py b/management/views.py index 59c6044..ef1a00e 100644 --- a/management/views.py +++ b/management/views.py @@ -1698,7 +1698,9 @@ def news_management_update(request,pk): image = request.FILES.get('image') if request.POST.get('date'): date = request.POST.get('date') - News.objects.filter(id=pk).update(type=t, title=title, author=author, date=date, content=content, source=source, image=image) + News.objects.filter(id=pk).update(type=t, title=title, author=author, date=date, content=content, source=source) + news.image = image + news.save() else: News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content, source=source, image=image)