dynamic-django-forms icon indicating copy to clipboard operation
dynamic-django-forms copied to clipboard

multiple fields in single form

Open panizza opened this issue 4 years ago • 2 comments
trafficstars

I tried to have multiple FormField in the same model, but I found some issues:

  • formbuilder.html use a static id (fb-editor)
  • the script are included multiple times

I can create a pull request, but I wanted to know how to you want this done. For the first part we can just prepend/append the widget's name to the current id, but for the latter I think we should remove the script tags entirely. This way everyone can include them where they feel better.

panizza avatar Oct 21 '21 11:10 panizza

Hi, sorry for the late response. If you still have a use case for this, here's what I'm thinking:

  • Allow overriding the templates for FormBuilderWidget and FormRenderWidget (via settings?)
  • Generate and assign a unique ID instead of a constant fb-editor (widget name sounds good, or maybe a UUID?)
  • Split the scripts / styles out into their own templates so they can be included more easily if overriding templates. Not sure if it should be possible to include/exclude those into the default builder/render templates via some form of settings, I haven't been keeping up to date with Django conventions.

askvortsov1 avatar Jan 15 '22 00:01 askvortsov1

Just put this on the README (a bit too late, tbh), but I'm not using Django in any projects, and am open to someone else taking over maintenance of this package. I don't really have the time or need to push new features at the moment.

askvortsov1 avatar Apr 16 '23 19:04 askvortsov1