摘要: 个人比较喜欢restful风格,以为django要安装rest framework才支持restful. 偶然发现只需继承View类即可.from django.views.generic import Viewclass TaskView(View): # 获... 阅读全文
posted @ 2015-06-07 11:31 妙音 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 自定义函数与内建函数重名,又不想改为,怎么办?加前缀. 例如:list可以使用builtin.list区分import __builtin__def list(f): ''' 将返回结果转为list ''' def __call(*args,... 阅读全文
posted @ 2015-06-07 11:29 妙音 阅读(730) 评论(0) 推荐(1) 编辑
摘要: 说明看见这个标题觉得有些好笑。受先入为主观念影响,心里隐约觉得动态加载有点慢,最近受一些启发,开始思考java反射、python动态加载的性能问题. 下面是测试python不同加载方式的性能示例有m1.py m2.py m3.py三个文件,内容如下class Test... 阅读全文
posted @ 2015-06-07 11:24 妙音 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 重新来这里看看,发现还不错,决定在这里写文章,以前写的东西懒得搬回来,下面是个人博客博客1:www.zhulinjingshe.cn博客2:yongqing.is-programmer.com 阅读全文
posted @ 2015-06-07 11:05 妙音 阅读(71) 评论(0) 推荐(0) 编辑