上一页 1 2 3 4 5 6 ··· 26 下一页
摘要: 记录一些我用过的命令 1 sudo apt-get update 3 sudo apt-get install vim 5 vim /etc/apt/sources.list 6 cd /etc/apt/ 8 sudo vim /etc/apt/sources... 阅读全文
posted @ 2015-03-15 22:29 r3call 阅读(3212) 评论(0) 推荐(1) 编辑
摘要: 下面是一个表单,有一个onclick按钮,点击后上面文本框的内容被添加到下面的文本域中,并可以一直添加,然后点击submit后提交到另一个页面。但是,在Ie9或者火狐浏览器中我一点onclick为什么总是提交表单,在搜狗,360浏览器中并未出现这样的状况。想问是不是浏览器的兼容问题,该如何解决。 ... 阅读全文
posted @ 2015-03-11 23:56 r3call 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 在.vimrc中添加以下代码后,重启vim即可实现按TAB产生4个空格:set ts=4 (注:ts是tabstop的缩写,设TAB宽4个空格)set expandtab对于已保存的文件,可以使用下面的方法进行空格和TAB的替换:TAB替换为空格::set ts=4:set expandtab:%r... 阅读全文
posted @ 2015-03-11 23:56 r3call 阅读(215) 评论(0) 推荐(0) 编辑
摘要: http://chriskief.com/2013/10/19/limiting-upload-file-size-with-django-forms/ 阅读全文
posted @ 2015-03-11 23:55 r3call 阅读(199) 评论(0) 推荐(0) 编辑
摘要: return HttpResponse('Invalid Method',status=405) 阅读全文
posted @ 2015-03-11 23:55 r3call 阅读(1231) 评论(0) 推荐(0) 编辑
摘要: class CategoryManager(models.Manager): """ A manager that adds an "active()" method for all active categories """ def active(self): ... 阅读全文
posted @ 2015-03-11 23:54 r3call 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 今天做一个拷贝功能,把某个 obj 拷贝并修改部分数据,提交表单后保存为一个新实例。结果google 出来的结果不对,都是相互copy 的代码,大概如下:1 obj = MyModel.objects.get(id=1)2 obj.pk = None3 obj.save()后来好不容易找到一个正确的... 阅读全文
posted @ 2015-03-11 23:48 r3call 阅读(1064) 评论(0) 推荐(0) 编辑
摘要: http://stackoverflow.com/questions/16231183/django-how-to-override-clean-method-in-a-subclass-of-custom-form 1 class SubClassForm(MyCustomForm): 2 # .... 阅读全文
posted @ 2015-03-11 23:47 r3call 阅读(465) 评论(0) 推荐(0) 编辑
摘要: ['%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59''%Y-%m-%d %H:%M', # '2006-10-25 14:30''%Y-%m-%d', # '2006-10-25''%m/%d/%Y %H:%M:%S... 阅读全文
posted @ 2015-03-11 23:46 r3call 阅读(2307) 评论(0) 推荐(0) 编辑
摘要: 1 import PIL 2 from PIL import ImageFont 3 from PIL import Image 4 from PIL import ImageDraw 5 6 #设置字体,如果没有,也可以不设置 7 font = ImageFont.truetype("/usr... 阅读全文
posted @ 2015-03-11 23:45 r3call 阅读(9634) 评论(1) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 26 下一页