Model exampleshttp://www.djangoproject.com/documentation/models/[django-ja:274]
Re: Model
としてファイルシステムを使う場合http://www.mail-archive.com/django-ja@googlegroups.com...
続きを読む
とりあえず使えそうなのをぺたぺたGoogle Charts template tags for
Django
続きを読む
Adminのlist_displayはManyToManyFieldを表示できない。そこで、カスタムメソッドを使って表示するやり方。def
selected_tags(self): '''return selected tags''' tag_titles = [] for tag_obj in
self.tags.all(): tag_titles.append(tag_obj.title) return
tag_titlesこれをlist_display = ('title', 'url'...
続きを読む
templateでcontextに変数一覧を表示する{% debug %}でイケる。{% debug
testsite.polls %}
続きを読む
まず、approotにdebugディレクトリを作り、その中にdebug用pyを作る。mkdir
debugcd debugtouch __init__.pyvi db.py[db.py]from django.conf import settingsfrom
django.db import connectionclass DBDebugMiddleware: """ "DBDebug" middleware for debug
out O/R Mapper's SQL: """ def pr...
続きを読む
kill -INT `cat /var/run/django.pid`
続きを読む
モデルフィールド フォームフィールド AutoField
フィールド上に表示されません BooleanField BooleanField CharField
max_length がモデルフィールドの maxlength と同じ値の CharField
CommaSeparatedIntegerField CharField DateField DateField DateTimeField DateTimeField
Emai...
続きを読む