add FieldSet.allow_continue, updated template

This commit is contained in:
Lance Edgar 2012-07-09 06:14:40 -05:00
parent 49a3aaa6bd
commit 7ab44b764e
3 changed files with 10 additions and 0 deletions

View file

@ -80,6 +80,7 @@ class FieldSet(formalchemy.FieldSet):
self.route_name = route_name or (self.class_name + 's')
self.url_action = url_action or url(self.route_name)
self.url_cancel = url_cancel or url(self.route_name)
self.allow_continue = kwargs.pop('allow_continue', False)
def get_display_text(self):
return unicode(self.model)

View file

@ -390,8 +390,10 @@ div.field-couple div.field select {
width: 320px;
}
/* unbound checkbox field, e.g. 'add another' */
div.checkbox {
margin: 15px 0px;
padding-left: 3px;
}
table.fieldset tbody tr {

View file

@ -35,6 +35,13 @@
% endfor
% if fieldset.allow_continue:
<div class="checkbox">
${h.checkbox('add-another', checked=True)}
<label for="add-another">Add another after this one</label>
</div>
% endif
<div class="buttons">
${h.submit('submit', "Save")}
<button type="button" class="cancel">Cancel</button>