📅  最后修改于: 2022-03-11 14:45:55.195000             🧑  作者: Mango
if form.is_valid():
post = form.save(commit=False)
post.author = request.user
post.published_date = timezone.now()
post.save()