Explorar o código

update migartionParse get info

tsteuer %!s(int64=4) %!d(string=hai) anos
pai
achega
b0f4d4f75d
Modificáronse 1 ficheiros con 10 adicións e 5 borrados
  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:
         '''
         '''