From 1683426ad89135bc4db7179d6e45589748b938a6 Mon Sep 17 00:00:00 2001
From: Bryan  BRANCOTTE <bryan.brancotte@pasteur.fr>
Date: Mon, 25 Jul 2022 15:47:48 +0200
Subject: [PATCH] add pre_process

---
 django_diu/import_command.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/django_diu/import_command.py b/django_diu/import_command.py
index ffee7c3..3717968 100644
--- a/django_diu/import_command.py
+++ b/django_diu/import_command.py
@@ -76,6 +76,9 @@ class ImportTask(object):
     def post_process(self):
         pass
 
+    def pre_process(self):
+        pass
+
     def _process_rows(self, rows, progress=None):
         for row in rows:
             try:
@@ -105,6 +108,7 @@ class ImportTask(object):
     def _run_import_loop(self):
         self.open_data_source()
         self.count_source()
+        self.pre_process()
         if self.progress_bar is True:
             with click.progressbar(length=self.source_count,
                                 label='Importing ' + self.description + ' (' + str(self.source_count) + ' rows to process).') as progress:
-- 
GitLab