Uncrispyfy DeviceGroupForm in seeddb#2994
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results 9 files 9 suites 8m 57s ⏱️ Results for commit 7fe2f74. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2994 +/- ##
==========================================
+ Coverage 56.30% 56.59% +0.28%
==========================================
Files 602 602
Lines 43728 43728
Branches 48 48
==========================================
+ Hits 24622 24746 +124
+ Misses 19094 18970 -124
Partials 12 12 ☔ View full report in Codecov by Sentry. |
|
Seems like edit- and add-forms in Anyway, with |
Is mostly universal, yet fields that require extra classes (like f.e. select2) need extra logic. Meaning that with few tweaks this template has a potential to fix all add/edit templates in /seeddb. Will finish and showcase this in a separate PR fixup
6af5ca9 to
25ce6c1
Compare
| queryset=Netbox.objects.all(), required=False | ||
| ) | ||
| netboxes.widget.attrs.update({"class": "select2"}) | ||
| no_crispy = True |
There was a problem hiding this comment.
When crispy is gone we will no longer need "no_crsipy" for choosing which form to show. It is still useful to hold extra form attributes though, like with the filter forms.
There was a problem hiding this comment.
Yes, we can remove no_crispy = True completely once all edit/add forms i seeddb are converted. Because then we can safely remove the {% if form.no_crispy %}-block from the seeddb/edit.html that was added in this PR and render {% include "seeddb/_form_fields.html" %} by default there
|
Are you considerimg adding django-widget-tweaks for the special casing? |
I was really tempted to add it while working on this one and investigating the situation with other edit/add forms in seeddb, but there was not overwhelmingly definite need so far. But will see how it goes with conversion of other fields, might happen that |
johannaengland
left a comment
There was a problem hiding this comment.
Only a small cosmetic suggestion
Co-authored-by: Johanna England <johanna.england@sikt.no>
Closes #2988
Introduces extra pattern - uncrispyfying of the required fields.