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()
相关文章
相关标签/搜索