Pārlūkot izejas kodu

update migartionParse get info

tsteuer 4 gadi atpakaļ
vecāks
revīzija
b0f4d4f75d
1 mainītis faili ar 10 papildinājumiem un 5 dzēšanām
  1. 10 5
      cdplib/db_migration/ParseMapping.py

+ 10 - 5
cdplib/db_migration/ParseMapping.py

@@ -118,14 +118,19 @@ class ParseMapping:
             "Invalid from field"
 
         result = {}
-
-        for d in self._mapping: 
-             if key in d and d[key] is not None and d[key]:
-                 result.update({d[self._source]: d[key]})
-            
+  
+        for column_mapping in self._mapping:
+
+            if (key in column_mapping and column_mapping[key] is not None\
+                and column_mapping[key] and (column_mapping[key] == value or value is None))\
+                or (column_mapping[key] == value):
+                    
+                 result.update({column_mapping[self._source]: column_mapping[key]})
+     
         return result
 
 
+
     def get_default_values(self) -> dict:
         '''
         '''