ConfirmImportForm should include custom form fields sent by ImportForm
See original GitHub issueCaveat: I’m new to Django Import/Export, so please correct me if I have the wrong ideas about the best ways of doing this.
My first use of DI/E required importing a file that was (deliberately) missing a column, with the intention of providing the extra column value in the import form. Eventually I worked out (what I think is) a good way of doing this, as I explained to someone else having the same problem - and then someone else, and someone else. In other words, it’s a pretty common problem.
But the use of sessions is messy, and may lead to weird bugs. It’d be better if ConfirmImportForm
carried across all form fields by default, including custom ones. Alternatively, if there was a way to specify which extra form fields to include. Another alternative is #880, which would require more work from implementers but would allow much more flexibility.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Hey! Sorry about that @yozlet. I’m having to dedicate all my time to getting a project ready first. Should be able to work on this over the weekend though!
Hey there! So I’m doing a similar thing with no modifications to DIE and without using sessions, but it’s a bit hacky. I’ll post what I’m doing later.
Here’s what I’m hoping to do long-term, let me know how this sounds to you - a new
import_export.fields.Field
subclass that is basically a prompt with a Django Form widget and pulls the value from that prompt instead of an actual column. Basically a synthetic column. Then to add this all you’d have to do is add likeand then that would show up as like “Yes or No or Maybe: …” on the import form.