按一般的CBVS实现,这个是编辑UPDATEVIEW完成之后,跳到LISTVIEW的. 但如果带跳到DETAILVIEW,则reverse_lazy需要带上参数进行跳转. 实现预定义的PK键跳转代码如下: class RightManageUpdateFATView(UpdateView): template_name = 'rightmanage/edit_fat_rightmanage.html' model = Site form_class = RightManageFATForm de
看到别人执行一个带命令行参数的python文件,瞬间觉得高大上起来.牛逼起来,那么如何编写一个带命令行参数的python脚本呢?不用紧张,下面将简单易懂地让你学会如何让自己的python脚本,支持带命令行参数的执行. 首先你要知道python中的sys模块的一些功能: import sys print "the number of python program's argument:",len(sys.argv) print "the value of every argum