A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://django-import-export.readthedocs.io/en/latest/import_workflow.html below:

Website Navigation


Import workflow — django-import-export 4.3.10.dev1 documentation

Import workflow

This document describes the import data workflow in detail, with hooks that enable customization of the import process.

Methods highlighted in yellow in the sequence diagram indicate public methods which can be overridden.

The import_data() method of Resource is responsible for importing data from a given dataset. Refer to the method documentation for parameters to this method.

This is what happens when the method is invoked:

  1. First, a new Result instance, which holds errors and other information gathered during the import, is initialized.

    Then, an BaseInstanceLoader responsible for loading existing instances is initialized. A different BaseInstanceLoader can be specified via ResourceOptions’s instance_loader_class attribute. A CachedInstanceLoader can be used to reduce number of database queries. See the instance_loaders for available implementations.

  2. The before_import() hook is called. By implementing this method in your resource, you can customize the import process.

  3. Each row of the to-be-imported dataset is processed according to the following steps:

  4. The Result is returned.

Transaction support

If transaction support is enabled, whole import process is wrapped inside transaction and rolled back or committed respectively. All methods called from inside of import_data() (create / delete / update) receive False for dry_run argument.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4