django-superform icon indicating copy to clipboard operation
django-superform copied to clipboard

There is no way to loop over all superform bound fields

Open kmmbvnr opened this issue 8 years ago • 0 comments

Composite fields not listed in the form.visible_fields and hidden_fields

Django suggest the form rendering customization by looping over form.hidden_field and form.visible_fields in the template - https://docs.djangoproject.com/ja/1.9/topics/forms/#looping-over-hidden-and-visible-fields. But the bound composite fields is not returned.

It seems it could be fixed but overriding __iter__ method

    def __iter__(self):
        for name in self.fields:
            yield self[name]
       for name in self.composite_fields:
           yield self[name]

kmmbvnr avatar Jun 30 '16 02:06 kmmbvnr