2011-03-28から1日間の記事一覧

クラスデコレータを使ってクラスのすべてのメソッドにデコレータを付加してみる。

クラスデコレータでクラス中のメソッド全部に入力出力の値を伝える機能を持たせてみる class Inspector(object): depth = 0 @classmethod def bind(kls, fn): def _bind(*args, **kw): indent = " " * kls.depth print "%s %sargs=%s, kw=%s" % (indent, fn,…

昨日の試みはうまくいかなそう。

instance生成できてないじゃん。instance_method定義するとき。

admin画面のURLをいじってQuerySetの絞り込み

memoなので雑。(後で手直し) admin.pyで list_filter = ["count"] のものは http://example.com:8000/admin/anything?count__lt=10 http://example.com:8000/admin/anything?count__lte=10 http://example.com:8000/admin/anything?count=10 http://exampl…