<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 431,  comments - 344,  trackbacks - 0

    If your site uses the same rendering logic for forms in multiple places, you can reduce duplication by saving the form's loop in a standalone template and using the include tag to reuse it in other templates:

    <form action="/contact/" method="POST">
    {% include "form_snippet.html" %}
    <p><input type="submit" value="Send message" /></p>
    </form>
    # In form_snippet.html:
    {% for field in form %}
    <div class="fieldWrapper">
    {{ field.errors }}
    {{ field.label_tag }}: {{ field }}
    </div>
    {% endfor %}
    

    If the form object passed to a template has a different name within the context, you can alias it using the with tag:

    <form action="/comments/add/" method="POST">
    {% with comment_form as form %}
    {% include "form_snippet.html" %}
    {% endwith %}
    <p><input type="submit" value="Submit comment" /></p>
    </form>
    

    If you find yourself doing this often, you might consider creating a custom inclusion tag.

    posted on 2009-04-03 11:58 周銳 閱讀(124) 評論(0)  編輯  收藏 所屬分類: Python
    主站蜘蛛池模板: 91在线手机精品免费观看| 在线视频网址免费播放| 嘿嘿嘿视频免费网站在线观看| 亚洲AV无码成人精品区蜜桃| 国产免费久久久久久无码| 国产国拍亚洲精品福利 | 亚洲AV伊人久久青青草原| 亚洲成AV人影片在线观看| 毛片免费观看的视频在线| 色偷偷亚洲女人天堂观看欧| 免费一本色道久久一区| 亚洲最大福利视频| 女人张开腿等男人桶免费视频| 国产午夜亚洲精品国产| 日韩一区二区免费视频| 免费播放国产性色生活片| 亚洲性久久久影院| 亚洲a一级免费视频| 亚洲国产精品人久久电影| 成年在线观看网站免费| 国产亚洲欧美日韩亚洲中文色| 免费一级成人毛片| 两性色午夜视频免费网| 亚洲视频在线一区| 成人免费一区二区无码视频| 亚洲爆乳无码专区www| 亚洲精品成人久久久| 久久免费高清视频| 国产成人精品日本亚洲11| 日韩免费视频播放| 三级毛片在线免费观看| 亚洲白色白色在线播放| 日韩高清在线免费观看| 久久久精品国产亚洲成人满18免费网站 | 亚洲性无码av在线| 国产精品色午夜免费视频| 抽搐一进一出gif免费视频| 亚洲精品不卡视频| 免费大黄网站在线观看| 午夜视频在线免费观看| 亚洲AV无码AV日韩AV网站|