{"id":3527,"date":"2010-06-24T22:43:23","date_gmt":"2010-06-24T13:43:23","guid":{"rendered":"http:\/\/www.gesource.jp\/weblog\/?p=3527"},"modified":"2017-07-16T15:20:47","modified_gmt":"2017-07-16T06:20:47","slug":"jinja2-%e3%81%a7%e3%83%ab%e3%83%bc%e3%83%97%e3%81%ae%e3%82%a4%e3%83%b3%e3%83%87%e3%83%83%e3%82%af%e3%82%b9%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.gesource.jp\/weblog\/?p=3527","title":{"rendered":"Jinja2 \u3067\u30eb\u30fc\u30d7\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/code.google.com\/p\/kay-framework\/\">Gogole App Engine\u7528\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af Kay<\/a> \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b <a href=\"http:\/\/jinja.pocoo.org\/2\/documentation\/\">Jinja2<\/a> \u3067\u30eb\u30fc\u30d7\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3002<\/p>\n<p>enumerate()\u307f\u305f\u3044\u306a\u3053\u3068\u3092Jinja2\u3067\u3057\u305f\u3044\u3002<\/p>\n<pre><code>for index, item in enumerate(items):\n  print '%d %s' % (index, item)\n<\/code><\/pre>\n<p><a href=\"http:\/\/jinja.pocoo.org\/2\/documentation\/\">Jinja2<\/a>\u306b\u306f\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u4f7f\u7528\u3067\u304d\u308b\u300cloop\u300d\u3068\u3044\u3046\u7279\u5225\u306a\u5909\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/jinja.pocoo.org\/2\/documentation\/templates#for\">Jinja2 Documentation for<\/a><\/li>\n<\/ul>\n<p>\u300cloop.index0\u300d\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30eb\u30fc\u30d7\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre><code>&lt;table&gt;\n{% for item in items %}\n  &lt;tr&gt;\n    &lt;td&gt;{{ loop.index0 }}&lt;\/td&gt;\n    &lt;td&gt;{{ item }}&lt;\/td&gt;\n  &lt;\/tr&gt;\n{% endfor %}\n&lt;\/table&gt;\n<\/code><\/pre>\n<p>\u300cloop.index\u300d\u306f\u3001\u30eb\u30fc\u30d7\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c1\u304b\u3089\u59cb\u307e\u308b\u3002<\/p>\n<pre><code>&lt;table&gt;\n{% for item in items %}\n  &lt;tr&gt;\n    &lt;td&gt;{{ loop.index }}&lt;\/td&gt;\n    &lt;td&gt;{{ item }}&lt;\/td&gt;\n  &lt;\/tr&gt;\n{% endfor %}\n&lt;\/table&gt;\n<\/code><\/pre>\n<p><iframe src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&#038;bc1=FFFFFF&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=gesource-22&#038;o=9&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=1X69VDGQCMF7Z30FM082&#038;asins=4048686291\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gogole App Engine\u7528\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af Kay \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b Jinja2 \u3067\u30eb\u30fc\u30d7\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3002 enumerate()\u307f\u305f\u3044\u306a\u3053\u3068\u3092Jinja2\u3067\u3057\u305f\u3044\u3002 for &#8230;<\/p>\n<p><a href=\"https:\/\/www.gesource.jp\/weblog\/?p=3527\" class=\"more-link\">Continue reading &lsquo;Jinja2 \u3067\u30eb\u30fc\u30d7\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[96,95,7],"tags":[68,94,143],"class_list":["post-3527","post","type-post","status-publish","format-standard","hentry","category-googleappengine","category-kay-programming","category-python","tag-google-app-engine","tag-kay","tag-python"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/3527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3527"}],"version-history":[{"count":0,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/3527\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}