I’ve extended the
event_registration.forms table so there are now two additional columns.
I have also used the
add_form_fields signal to add two additional text inputs to the
@signals.add_form_fields.connect def _add_sheep_registration_form_fields(form, **kwargs): if (form.__name__ == 'RegistrationFormForm'): yield ('sheep_booking_id', StringField('Sheep booking ID')) yield ('sheep_booking_type', StringField('Sheep booking type'))
But I now need to find a way to have this data stored in the
forms table but I feel like I’ve exhausted my options. I naively hoped that processing the form in the validated signal would do the trick:
@signals.form_validated.connect def _process_sheep_registration_fields(form, **kwargs): setattr(form, 'sheep_booking_id', form.ext__sheep_booking_id) setattr(form, 'sheep_booking_type', form.ext__sheep_booking_type)
But no dice here, so they I tried the
registration_form_created signal but I don’t have access to those attributes on the
@signals.event.registration_form_created.connect def _save_sheep_registration_fields(form, **kwargs): # nothing here :( return False
I’m now thinking that the only way to achieve this will be to override the blueprint routes somehow to use a custom controller but I hope there’s another way!
Any thoughts greatly appreciated!