django更改數據

title = request.POST.get('title')
 simple_introduction = request.POST.get('simple_introduction')
 content = request.POST.get('content')
 content = mark_safe(content)
 type = (int)(request.POST.get('types'))
 obj = models.Article.objects.get(id=p)
 obj.title = title
 obj.brif_introduce = simple_introduction
 obj.content = content
 obj.catery_id = type
  #必定要進行sava()
 obj.save()
相關文章
相關標籤/搜索