-
Notifications
You must be signed in to change notification settings - Fork 85
Additional Extension Points in FormBuilder and FormFieldStreamBlock #160
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
base: master
Are you sure you want to change the base?
Conversation
…verride when the field_name needs to be modified.
# Conflicts: # wagtailstreamforms/forms.py
…o wrds_forms_work # Conflicts: # setup.py
Merged #170 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #160 +/- ##
==========================================
+ Coverage 95.65% 95.68% +0.03%
==========================================
Files 28 28
Lines 943 951 +8
Branches 85 85
==========================================
+ Hits 902 910 +8
Misses 34 34
Partials 7 7 ☔ View full report in Codecov by Sentry. |
…ck to not be added
…work # Conflicts: # setup.py # tox.ini
Upgrade test suite to support Wagtail 2.15.
…work # Conflicts: # tox.ini
@leongraumans I wonder if this PR is appropriate for merge? If this'll never be picked up, that's totally fine, please just let me know and I can continue to maintain this work in my fork. Thanks |
…required app in INSTALLED APPS
Wagtail 3
…n of FormFieldsStreamField
# Conflicts: # setup.py # tests/hooks/test_process_form.py # tox.ini
…added to the StructBlock for a field.
# Conflicts: # wagtailstreamforms/blocks.py # wagtailstreamforms/forms.py # wagtailstreamforms/migrations/0001_initial.py # wagtailstreamforms/migrations/0003_alter_form_fields.py # wagtailstreamforms/models/form.py
Caught up to labd's master and added a new extension point: |
bump, and thank you for maintaining this project! |
Hi @rgs258, Happy new year, and apologies for the late reply! I'll come back to you later this week. |
…e return of subclass of a structural block for further control over the block class, such as overriding the clean() method to provide custom validation.
Added yet another extension point, |
I think I might share that we're using this package in a somewhat unconventional way. We've adapted it such that Pages themselves are the definition of the form. That is to say, we've made a subclass of Page for which the body StreamField has as local blocks all of the form elements registered to this package (in addition to the usual subclasses of FieldBlock). With this, an content author may create a page that itself is a form, and they may define that form inline with the page content. The Page, and the entire definition of the form, exist within the normal Wagtail system of revisions, permissions, workflow, previews (that was fun), etc.. This gives our content authors a great deal of freedom and allows out site to host ~2200 unique forms. Its a dream of mine to extract the non proprietary parts of our adaptation and open source them as a bolt-on to this package. ...just got to find the time :) |
…lf.get_form_block_class() and self.get_local_blocks() methods
811ed26
to
f132758
Compare
Adjusted |
Compatible Wagtail 6.0.1, Django 5.0.2
# Conflicts: # example/migrations/0001_initial.py # example/settings.py # example/wagtailstreamforms_fields.py
Adjusted to a hatch project. |
Compatible Wagtail 6.3, Django 5.1
# Conflicts: # setup.py # wagtailstreamforms/models/form.py
…tibility Updates the dependency requirements in the forked wagtailstreamforms package to: - Change Wagtail version requirement from `>5.2,<=6.0.1` to `>6.0,<=6.3` to work with Wagtail 6 releases - Replace `wagtail-generic-chooser` dependency with `wagtail-modeladmin` which is needed for Wagtail 6 compatibility - Retain the Unidecode dependency unchanged These changes align with upstream requirements and ensure compatibility with newer Wagtail versions.
This change just refactors the code a bit by creating new methods to override when subclassing
FormBuilder
orFormFieldStreamBlock
for customization:FormBuilder
, created:create_field_class
andcreate_field_name
FormFieldStreamBlock
, created:instantiate_block
BaseField
, created:get_local_blocks
BaseField
, created:get_form_block_class
BaseField
, created:get_form_block_kwargs
Please let me know if there's anything else I can do to help this get merged. If you need me to write tests, if you can you please let me know what the signature of each test should be, I will fill in the blanks.
Thanks!