Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no way to loop over all superform bound fields #15

Open
kmmbvnr opened this issue Jun 30, 2016 · 0 comments
Open

There is no way to loop over all superform bound fields #15

kmmbvnr opened this issue Jun 30, 2016 · 0 comments

Comments

@kmmbvnr
Copy link

kmmbvnr commented Jun 30, 2016

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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant