diff -r 9c414dbc76da -r 37154aa90947 web/views/formrenderers.py --- a/web/views/formrenderers.py Thu Jul 30 18:49:24 2009 +0200 +++ b/web/views/formrenderers.py Thu Jul 30 18:50:41 2009 +0200 @@ -193,7 +193,16 @@ byfieldset = {} for field in fields: byfieldset.setdefault(field.fieldset, []).append(field) - for fieldset, fields in byfieldset.iteritems(): + if form.fieldsets_in_order: + fieldsets = form.fieldsets_in_order + else: + fieldsets = byfieldset.keys() + for fieldset in fieldsets: + try: + fields = byfieldset.pop(fieldset) + except KeyError: + self.warning('no such fieldset: %s (%s)', fieldset, form) + continue w(u'
') + if byfieldset: + self.warning('unused fieldsets: %s', ', '.join(byfieldset)) def render_buttons(self, w, form): if not form.form_buttons: