gregmuellegger / django-superform

Add forms and formsets to other forms like they were fields.

Home Page:http://django-superform.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better document usage in templates

garncarz opened this issue · comments

It took me quite some time to find out I should use {% bootstrap_form form.forms.my_inner_form %} and {% bootstrap_field form.forms.my_inner_form.my_inner_field %}. Actual documentation talks about form.composite_fields a lot, but that's not usable here. Also {{ form.my_inner_form }} works, but {% bootstrap_form form.my_inner_form %} surprisingly doesn't.

Hi, thanks for the suggestion. I don't know the django-bootstrap3 library but it probably only accepts Django's BoundField and standard Django forms. However to make superform work, we need to extend those datastructures quite a bit in order to bring the extra functionality into existing forms.

But, yes, I agree that we should better document what kind of data/types the {{ form.my_inner_form }} or {{ form.forms.my_inner_form }} constructs do return. We need to do that in a generic way though and cannot only speak about django-bootstrap3 as this would be to very limitted.

Nevertheless, thanks for the project, so far it seems to work alright and makes form creation really easier/cleaner.

Cool. Glad that it helps :) Spread the word if you like it.