diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-09-25 13:43:13 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-09-25 13:43:36 +0200 |
commit | d3c96dbb05352d417ca2f88797e6ae44534e7f86 (patch) | |
tree | a674c9813ed7bc8fa9bdc5ac4efadc07209cf3e7 /ishtar_common/data_importer.py | |
parent | 1f81bcd6625c7c411181c702a903781f3d3c7285 (diff) | |
download | Ishtar-d3c96dbb05352d417ca2f88797e6ae44534e7f86.tar.bz2 Ishtar-d3c96dbb05352d417ca2f88797e6ae44534e7f86.zip |
Imports: manage boolean association on DB
Diffstat (limited to 'ishtar_common/data_importer.py')
-rw-r--r-- | ishtar_common/data_importer.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 19746315a..16d9ce8d8 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -408,18 +408,11 @@ class StrToBoolean(Formater, ChoiceChecker): self.missings = set() if self.db_target: for target_key in self.db_target.keys.filter(is_set=True).all(): - value = target_key.value - value = self.prepare(value) - if value in self.dct: + key = self.prepare(target_key.key) + if key in self.dct: continue - v = target_key.key - if v in ('False', '0'): - v = False - elif v: - v = True - else: - v = None - self.dct[value] = v + v = target_key.format() + self.dct[key] = v self.new_keys = {} def prepare(self, value): |