美文网首页
写文章在简书

写文章在简书

作者: 何波lanvy | 来源:发表于2018-06-14 00:16 被阅读9次

```

def productionplans_create(request):

if request.user.is_anonymous():

return render(request,"home_view.html",{"message":"未登录!"})

elif not request.user.is_superuser:

if not (request.user.employee.department == DepartmentStatus.TECHNICAL_DEPARMENT

or request.user.employee.department == DepartmentStatus.MANAGER_DEPARMENT

or request.user.employee.department == DepartmentStatus.PRODUCTION_VICEPRESIDENT):

return render(request,"home_view.html",{"message":"没有权限查看该模块内容!"})

form = ProductionPlanForm(request.POST or None)

if request.method == 'POST':

if form.is_valid():

time = str(datetime.datetime.now())

title = "JTL_I_" + str(time[0:4]) + str(time[5:7]) + str(time[8:10]) + str(time[11:13]) + str(time[14:16]) + str(time[17:19])

request.session['title'] = title

request.session['department'] = form.cleaned_data.get("department").department_name

#print(request.session['department'])

request.session['ingredient_plan_id'] = form.cleaned_data.get("ingredient_plan").id

request.session['input_weight_plan'] = form.cleaned_data.get("input_weight_plan")

request.session['ingredient_weight_plan'] = form.cleaned_data.get("ingredient_weight_plan")

request.session['start_date'] = str(form.cleaned_data.get("start_date"))

request.session['complete_date'] = str(form.cleaned_data.get("complete_date"))

request.session['is_publish'] = form.cleaned_data.get("is_publish")

return redirect(reverse("productionplans:createplan"))

context = {

"productionplan_form":form,

}

return render(request, "productionplan_create.html", context)

```

相关文章

  • 写文章在简书

    ``` def productionplans_create(request): if request.user....

  • FTN征文大赛 |贡献内容生态系统中简书钻与FTN的一点思路

    如果最近你在简书写文章,你的思绪一定集中在FTN和简书钻上面。 简书钻成为在简书写文章的通证。最近简书钻的实行,对...

  • 开篇

    天下文章在简书, 我来简书写文章。

  • 备忘

    &@点击简书→写文章_→添加到桌面,点击写文章,即可。简书幚定手机17691190051@ 《给简书添加图片方法》...

  • 尝试在简书发贴

    从天涯知道简书,但从末在简书发贴写文章。于是尝试一下。

  • 关于点赞

    在《简书》写文章纯粹是为了爱好。文后收到简友的点赞也是非常欣喜。因为那是对我所写文章的肯定。 我也在《简书》中,阅...

  • 2019-11-15

    为什么要写简书 为什么要写简书,为什么要在简述里写文章呢? 其实一开始的时候,我只是简单的在想,在简书里写文章可以...

  • 嗨简书,我又回来了

    因为简书,我开始写文章,因为简书,我停止了写文章,因为简书,我又回来了。 简书带给我太多东西了,所以我不得不回来,...

  • 2021-07-16

    简书 markdown 语法的使用 在简书里如何发帖子 首先我们去简书注册账号 点击右上角的 写文章 ,在...

  • 貌似简书可以写文章

网友评论

      本文标题:写文章在简书

      本文链接:https://www.haomeiwen.com/subject/rakpvttx.html