django

1.安装配置Django开发环境(Eclipse + Pydev)
    http://hi.baidu.com/yobin/blog/item/3c7a39f3f466e555342acc05.html
2.几句话入门Python自带编辑器IDLE
   http://houniao.javaeye.com/blog/603535
3.django form 外键过滤
    form = BookmarkForm();
     #只显示用户拥有的类型.
            form.fields['type'].queryset = BookmarkType.objects.filter(user=request.user);
4.admin中 list_display等属性不接受manytomanyfield.
5.chekbox
T:
     {%for category in category_list%}
   <input type="checkbox" name="category" value ="{{category.id}}" >       {{category.name}}<br>
  {%endfor%}
V:
return HttpResponse(category_list[0]+category_list[1]+category_list[2]);
6.分页:
    http://code.google.com/p/django-pagination/
   setting.py
    INSTALLED_APPS = (
           # ...
           'pagination',
       )
       MIDDLEWARE_CLASSES = (
           # ...
           'pagination.middleware.PaginationMiddleware',
       )
      TEMPLATE_CONTEXT_PROCESSORS=("django.core.context_processors.auth",
        "django.core.context_processors.debug",
        "django.core.context_processors.i18n",
        "django.core.context_processors.media",
        "django.core.context_processors.request")
     模板:
          {% autopaginate objList 10%}
             {%for obj in objList%}
              {%endfor%}
           {% paginate %}
7.IE下的 ERROR_INTERNET_CONNECTION_ABORTED
   转到生产环境下就OK了..
 
 

你可能感兴趣的:(django,职场,休闲)