1.安裝配置Django開發環境(Eclipse + Pydev)
2.幾句話入門Python自帶編輯器IDLE
3.django form 外鍵過濾
form = BookmarkForm();
#只顯示用戶擁有的類型.
form.fields['type'].queryset = BookmarkType.objects.filter(user=request.user);
#只顯示用戶擁有的類型.
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%}
<input type="checkbox" name="category" value ="`category`.`id`" > `category`.`name`<br>
{%endfor%}
V:
return HttpResponse(category_list[0]+category_list[1]+category_list[2]);
setting.py
INSTALLED_APPS = (
# ...
'pagination',
)
# ...
'pagination',
)
MIDDLEWARE_CLASSES = (
# ...
'pagination.middleware.PaginationMiddleware',
)
# ...
'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")
"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%}
{% autopaginate objList 10%}
{%for obj in objList%}
{%endfor%}
{% paginate %}
7.IE下的ERROR_INTERNET_CONNECTION_ABORTED
轉到生產環境下就OK了..