[muledit] form may contains subforms with nothing editable that will be s kipped, so ensure we choose one with something to display when rendering table headers
--- a/web/views/formrenderers.py Wed Sep 29 09:01:57 2010 +0200
+++ b/web/views/formrenderers.py Wed Sep 29 12:13:44 2010 +0200
@@ -335,8 +335,14 @@
def render_fields(self, w, form, values):
if form.parent_form is None:
w(u'<table class="listing">')
- subfields = [field for field in form.forms[0].fields
- if field.is_visible()]
+ # get fields from the first subform with something to display (we
+ # may have subforms with nothing editable that will simply be
+ # skipped later)
+ for subform in form.forms:
+ subfields = [field for field in subform.fields
+ if field.is_visible()]
+ if subfields:
+ break
if subfields:
# main form, display table headers
w(u'<tr class="header">')