Move the selection out of the DataImport payload
When running a DataImport from a selection, the selection's element IDs are currently copied as a list in the payload: {"elements": [id, id, id…]}
. It could be possible to add a ?user=
option on the selection list API, to let init_elements
use the DataImport's creator, but this would allow a user to update or erase its selection and mess with ongoing or previous workflows.
Add a many-to-many field like Selection
between a DataImport
and Element
, and duplicate the Selection
to this new model when creating an import from the selection. There might be a need to use a INSERT SELECT
or something similar to ensure this endpoint is fast even for thousands of elements.