request.POST.get

http://www.runoob.com/python/att-dictionary-get.html

Python 字典(Dictionary) get() 函数返回指定键的值,如果值不在字典中返回默认值。

 

本质上是一个字典方法

request.POST可以看做是一个字典

比如mobile = request.POST.get("mobile","12345678910")可以看做

mobile = request.POST["mobile"]
if mobile == None:
    mobile = "12345678910"

 大概是这样吧

其他的一些也是如此

posted @ 2018-10-30 09:38  茫茫碧落  阅读(2795)  评论(0编辑  收藏  举报