bethlakshmi / gbe-divio-djangocms-python2.7

3rd try is the charm - Divio Cloud, Django CMS, Python 3.x, Django 3.x
Apache License 2.0
6 stars 1 forks source link

dynamic forms #173

Open bethlakshmi opened 3 years ago

bethlakshmi commented 3 years ago

Research what's out there for django powered dynamic form construction so that a user could add new questions to bid forms on a bid type by bid type basis.

We'd probably also want to have the forms be versionable in someway so that answers to old forms stay around, even when new forms with different questions are in use.

burlexpo commented 3 years ago

Looking a Django packages the strongest contender I see is Django-FOBI https://djangopackages.org/packages/p/django-fobi/ actively in production. The current version is Beta, but there may be an earlier, production ready version. It supports multiple versions of Django, has a drag and drop interface, there's a live demo of the various aspects, and there's pretty thorough documentation.

Another option is Django-Form-Bulider https://djangopackages.org/packages/p/django-forms-builder/ stable but it hasn't been updated since 2018 and no CAPTCHA integration,

bethlakshmi commented 4 months ago

489 just brought this back to the fore front.

Given that this is nontrivial work, I'm gonna do the work to integrate the tool here. Then figure out how to fit it into the Sign Forms flow in #489.

bethlakshmi commented 4 months ago

@burlexpo - I just got FOBI (your first link on this ticket) up and running. It's no longer in beta, but it does have its pluses and minuses.

I put it up on our test site. You can play with it here:

https://burlesque-expo-stage.us.aldryn.io/fobi/

I made a demo form and put it into your account.

Let's talk this afternoon (I have class 11-1, and then I'm headed back to Dorchester) - could meet up after 3?

My review so far:

If we want to integrate this with the signing system I just built: 1 - I will need to write a way to connect the "this type of user needs to sign this form" config to these forms - not too hard 2 - I will need to find a way annotate that this user is filling out this form for this conference. The "this user" part is already there. The "this conference" would be something like a hidden field... which is available, but I'll have to figure out how to make that work. - harder 3 - I need to find a way to query the form data to see who has done it, vs. who hasn't - medium hard 4 - I need to write a presentation view for users and for registration so people can see their own form data, and registration can see everyone's form data (or if they only need to see that someone signed it... that's easier). - harder 5 - we need to figure out what to do about complicated form validation - the radio button + username of payment system - I believe I can write a plugin for this, but I need to see how hard that is. - hardish

bethlakshmi commented 4 months ago

All that said, while the docs for this thing are sometimes frustrating, they are the most comprehensive docs of any of the sites I've seen, so this would be my pick for easiest thing to do.

And I could put some stuff on the back burner - for example, these forms don't have to look pretty right now - we could figure out how to have them look GBE-ish later.

bethlakshmi commented 4 months ago

Another aspect of this solution - FOBI can restrict form access to users. But that's about all it can do. It can't limit WHICH user in any way I can see (w/out me doing more work) - we can go with security by obscurity - so if we give one user the URL and don't give it to another user, theoretically, we won't get crap data.

But if, for example, we have Tina Troupe Leader who is the contact for the Delicious Duet with Suzie Someone-else, and we ask Tina to give us her payment info for tips. If Tina then helpfully shares the link for the payment info with Suzie, because she doesn't realize we tip per group, not per person, then we will have an entry from Tina and an entry from Suzie. So we need to do a bit of checking when we process this stuff.

bethlakshmi commented 4 months ago

Check this out!! Gave it a crack in case it helped, and doing this was quite quick:

https://burlesque-expo-stage.us.aldryn.io/submit-payment/

It's a bit fussy, but what I did was:

And now it looks way more like "our" pages. Help text and stuff is still formatted the FOBI way, but I can see how I can customize that too.

Using this trick complicates the setup a bit, I may need more when setting up the rules for who-gets-what. But I think it's worth it.

bethlakshmi commented 4 months ago

I may put this on hold during traveling. There's a lot of trial and error and frustration on work like this, as well as searching the interwebs for answers. With the current frustration afoot, I don't have the heart for it.

I will probably poke at things that are just satisfying for me, or so suitably easy that the gratification is candy-bar-like in it's ease of acquisition.