Skip to content

Instantly share code, notes, and snippets.

@Palmik
Palmik / form-example.html
Created December 4, 2012 11:16 — forked from wichert/form-example.html
WTForms and pyramid integration
<form id="loginForm" method="post" action="${request.route_url('login')}">
<input type="hidden" name="csrf_token" value="${request.session.get_csrf_token()}"/>
<fieldset class="concise">
<metal:field tal:define="name 'came_from'" use-macro="snippets['hidden']"/>
<metal:field tal:define="name 'login'" use-macro="snippets['text']"/>
<metal:field tal:define="name 'password'" use-macro="snippets['password']"/>
</fieldset>
<div class="buttonBar">
<button type="submit" class="default" i18n:translate="">Login</button>
</div>
<form method="POST" action="whatever">
<tal:block
define="form view.addrform">
<div class="row"
tal:repeat="field form">
<div class="span2">
${structure:field.title}
<span class="req" tal:condition="field.required">*</span>
</div>