#修改
This commit is contained in:
parent
694a011de1
commit
6b505bbbe4
|
@ -1696,14 +1696,19 @@ def news_management_update(request,pk):
|
||||||
t = '6'
|
t = '6'
|
||||||
if request.FILES.get('image'):
|
if request.FILES.get('image'):
|
||||||
image = request.FILES.get('image')
|
image = request.FILES.get('image')
|
||||||
|
n = News.objects.get(id=pk)
|
||||||
if request.POST.get('date'):
|
if request.POST.get('date'):
|
||||||
date = 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)
|
News.objects.filter(id=pk).update(type=t, title=title, author=author, date=date, content=content, source=source)
|
||||||
news.image = image
|
|
||||||
news.save()
|
|
||||||
|
n.image = image
|
||||||
|
n.save()
|
||||||
else:
|
else:
|
||||||
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
|
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
|
||||||
source=source, image=image)
|
source=source)
|
||||||
|
n.image = image
|
||||||
|
n.save()
|
||||||
else:
|
else:
|
||||||
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
|
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
|
||||||
source=source)
|
source=source)
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 650 KiB |
Loading…
Reference in New Issue