Allow ConfigForms to use fieldsets.
Review Request #9045 — Created June 29, 2017 and submitted
This change updates things so that if a ConfigForm has fieldsets, they'll be
rendered correctly (as opposed to just having all the fields rendered together
as if the fieldsets didn't exist).This has one small niggle in that if a person defines their own fieldsets, one
of those fieldsets must contain theform_target
field. I've added a log
statement to help people figure out what went wrong if they didn't include
this.Testing done:
- Ran unit tests.
- Used this in conjunction with a Review Board change.
- Ran unit tests.
- Used this in conjunction with a Review Board change.
Description | From | Last Updated |
---|---|---|
I don't really love duplicating all this. How about introducing a djblets/forms/templates/form_fieldset.html that works as a base for this and … |
chipx86 | |
The class= should probably be within the if {% fieldset.classes %}. |
chipx86 | |
Can you pass the request? |
chipx86 | |
Alphabetical order. |
chipx86 | |
We should use a module-level logger here. |
brennie | |
form ? |
brennie |
-
-
I don't really love duplicating all this. How about introducing a
djblets/forms/templates/form_fieldset.html
that works as a base for this and the admin one? It could take aextra_fieldset_classes
variable that the admin one can pass down formodule aligned
, along with a template name that can be passed for the field name.Similarly, we could have a base for the
form_field.html
.We used to have a lot of copies of these rules, which was painful to clean up, so I'm hoping to keep it as tidy and consistent as possible.
-
-
-
- Change Summary:
-
Reduce duplication between admin and config forms.
- Commit:
-
42e3b14d521d8c1c97fa28f29e2abc6d3faa29ae886d3f8f44a5481ed2500fade9e39f8565ff20fb
- Diff:
-
Revision 2 (+56 -52)