You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,15 @@
1
1
**Django Data Wizard** is an interactive tool for mapping structured data (e.g. Excel, XML) into a normalized database structure via [wq.io] and the [Django REST Framework]. Django Data Wizard allows novice users to map spreadsheet columns to serializer fields (and cell values to foreign keys) on-the-fly during the import process. This reduces the need for preset spreadsheet formats, which most data import solutions require.
By default, Django Data Wizard supports any format supported by [wq.io] (Excel, CSV, JSON, and XML). Additional formats can be integrating by creating a [custom wq.io class] and then registering it with the wizard. For example, the [Climata Viewer] uses Django Data Wizard to import data from [climata]'s wq.io-based web service client.
4
14
5
15
The Data Wizard supports straightforward one-to-one mappings from spreadsheet columns to database fields, as well as more complex scenarios like [natural keys] and [Entity-Attribute-Value] (or "wide") table mappings. It was originally developed for use with the [ERAV data model][ERAV] provided by [vera].
@@ -137,6 +147,10 @@ If you are using wq.db, you could allow the user to initiate an import run by ad
The `auto` task attempts to run the entire data wizard process from beginning to end. If any input is needed, the import will halt and redirect to the necessary screen. If no input is needed, the `auto` task is equivalent to starting the `data` task directly. This is an asynchronous method, and returns a `task_id` to be used with the status API.
141
155
142
156
The default [run_detail.html] template provides an example form to initiate the `auto` task.
@@ -172,6 +186,10 @@ The default [run_auto.html] and [run_data.html] templates include a `<progress>`
The `serializers` task provides a list of all registered serializers. This screen is shown by the `auto` task if a serializer was not specified when the `Run` was created. The default [run_serializers.html] template includes an interface for selecting a registered serializer. If a serializer is already selected, the template will display the label and a button to (re)start the `auto` task.
The `columns` task lists all of the columns found in the dataset (i.e. spreadsheet) and their mappings to serializer fields. This screen is shown by the `auto` task if there are any column names that could not be automatically mapped. The potential mappings are one of:
190
212
* simple serializer field names (e.g. `field`)
191
213
* nested field names (for [natural keys], e.g. `nested[record][field]`)
The `ids` task lists all of the identifiers found in the dataset (i.e. spreadsheet) that are in a column known to correspond to a foreign key. This screen is shown by the `auto` task if there are any identifiers that could not be automatically mapped to foreign key values. The potential mappings depend on the serializer field used to represent the foreign key.
211
237
212
238
* Existing record ID or slug (for [PrimaryKeyRelatedField], [SlugRelatedField], and [NaturalKeySerializer][natural keys])
The `data` task starts the actual import process (and is called by `auto` behind the scenes). Unlike `auto`, calling `data` directly will not cause a redirect to one of the other tasks if any meta input is needed. Instead, `data` will attempt to import each record as-is, and report any errors that occured due to e.g. missing fields or unmapped foreign keys.
231
262
232
263
This is an asynchronous method, and returns a `task_id` to be used with the `status` API. The default [run_data.html] template includes a `<progress>` element for use with [wq/progress.js] and the status task.
The `records` task provides a list of imported rows (including errors). It is redirected to by the `auto` and `data` tasks upon completion. When used with wq.db, the `records` task includes links to the detail page for each newly imported record. The default [run_records.html] template includes an interface for displaying the record details.
0 commit comments