会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
平凡的程序员
博客园
新随笔
管理
上一页
1
2
3
4
5
6
下一页
2009年12月11日
from django.http import HttpResponseRedirect
摘要: return HttpResponseRedirect(reverse(index))
阅读全文
posted @ 2009-12-11 14:34 kid的笔记本
阅读(490)
评论(0)
推荐(0)
编辑
return self.user.username
摘要: classEvent(models.Model):user=models.ForeignKey(User) def__unicode__(self): returnself.user.username+u'的事件' 注意 user.username
阅读全文
posted @ 2009-12-11 10:35 kid的笔记本
阅读(228)
评论(0)
推荐(0)
编辑
2009年12月7日
poedit出错
摘要: 把django-admin.py copy 到对应的项目下,结果报错:errors happened while running xgettext on __init__.py ,不应该啊,俺是按照http://docs.djangoproject.com/en/dev/topics/i18n/#gettext-on-windows 一步一步做的么~~~最后google了半天,才知道,得重启cmd...
阅读全文
posted @ 2009-12-07 16:27 kid的笔记本
阅读(262)
评论(0)
推荐(0)
编辑
2009年12月4日
if not 'request' in context:
摘要: if not 'request' in context:
阅读全文
posted @ 2009-12-04 10:28 kid的笔记本
阅读(83)
评论(0)
推荐(0)
编辑
2009年12月2日
django 密码 好文
摘要: http://ddkangfu.blog.51cto.com/311989/77265/
阅读全文
posted @ 2009-12-02 18:06 kid的笔记本
阅读(109)
评论(0)
推荐(0)
编辑
2009年12月1日
map lambda
摘要: map((lambda x:x+1), x)def true(): return True; <=> lambda :True>>>a = lambda : True>>>a() def add(x, y): return x + y; <=> lambda x, y: x + y >>>a = lambda x, y:...
阅读全文
posted @ 2009-12-01 15:17 kid的笔记本
阅读(217)
评论(0)
推荐(0)
编辑
2009年11月27日
Django Form 学习
摘要: http://www.kuangxuqing.com/2008/12/25/form-in-django.6693.html
阅读全文
posted @ 2009-11-27 14:17 kid的笔记本
阅读(144)
评论(0)
推荐(0)
编辑
2009年11月25日
import traceback
摘要: import tracebacks = traceback.extract_stack()得知被谁调用
阅读全文
posted @ 2009-11-25 09:44 kid的笔记本
阅读(516)
评论(0)
推荐(0)
编辑
2009年11月24日
related_name
摘要: django还有一种通过对象访问相关联表数据的方法,即用_set。但是这种方法只能是相关类访问定义了关系的类(主键类访问外键类)。如:b.entry_set.all() #b是一个blog对象另外还有就是如果Entry中blog属性的定义如果改成这样:blog=ForeignKey(Blog,related_name='entries')这样的话就可以像下面这样通过blog对象得到entry对象的...
阅读全文
posted @ 2009-11-24 14:00 kid的笔记本
阅读(1198)
评论(0)
推荐(0)
编辑
django 国际化 ugettext()
摘要: 使用函数 <tt class="docutils literal"><span class="pre">ugettext()</span></tt> 来指定一个翻译字符串。 作为惯例,使用短别名 <tt class="docutils literal"><span class="pre">_</span></...
阅读全文
posted @ 2009-11-24 09:47 kid的笔记本
阅读(984)
评论(0)
推荐(0)
编辑
上一页
1
2
3
4
5
6
下一页