Identifier Choices
GET /datawizard/[id]/ids
The ids
task lists all of the foreign key values found in the source dataset (i.e. spreadsheet). If there are any unmapped foreign key values, the auto task will stop and redirect to the ids
task. The default run_ids.html template (and corresponding RunIds react view) includes an interface for mapping row identifiers to foreign key values. The potential mappings depend on the serializer field used to represent the foreign key.
- For PrimaryKeyRelatedField, SlugRelatedField, and NaturalKeySerializer, the choices will include all existing record ID or slugs.
- For
NaturalKeySerializer
only, a"new"
choice will also be included, allowing for the possibility of creating new records in the foreign table on the fly.
Once all ids are mapped, the template will display the mappings and a button to (re)start the auto
task.
Note that the auto
task will skip the ids
task entirely if any of the following are true:
- The file contains no foreign key columns
- All foreign key values were already mapped during a previous import run
- All foreign key values can be automatically mapped via the
DATA_WIZARD['IDMAP']
setting.