@@ -85,26 +85,19 @@ def fix_lookup_path(cls, data:Any, info: ValidationInfo)->Any:
85
85
86
86
@staticmethod
87
87
def get_lookups (text_field : str , director :DirectorOutputDto , ignore_lookups :set [str ]= LOOKUPS_TO_IGNORE )-> list [Lookup ]:
88
+ # Comprehensively match all kinds of lookups, including inputlookup and outputlookup
88
89
inputLookupsToGet = set (re .findall (r'inputlookup(?:\s*(?:(?:append|strict|start|max)\s*=\s*(?:true|t|false|f))){0,4}\s+([^\s]+)' , text_field ))
89
90
outputLookupsToGet = set (re .findall (r'outputlookup(?:\s*(?:(?:append|create_empty|override_if_empty|max|key_field|allow_updates|createinapp|create_context|output_format)\s*=\s*[^\s]*))*\s+([^\s]+)' ,text_field ))
90
- # Don't match inputlookup or outputlookup. Allow local=true or update=true or local=t or update=t
91
- lookups_to_get = set (re .findall (r'(?:(?<!output)(?<!input))lookup(?:\s*(?:(?:local|update)\s*=\s*(?:true|t|false|f))){0,2}\s+([^\s]+)' , text_field ))
92
- #lookups_to_get = set(re.findall(r'[^output]lookup (?:update=true)?(?:append=t)?\s*([^\s]*)', text_field))
93
- #lookups_to_get = set(re.findall(r'(?!output)lookup(?:\s*(?:(?:local|update)\s*=\s*(?:true|t))){0,2}\s+([^\s]+)', text_field))
94
-
95
-
96
-
91
+ lookupsToGet = set (re .findall (r'(?:(?<!output)(?<!input))lookup(?:\s*(?:(?:local|update)\s*=\s*(?:true|t|false|f))){0,2}\s+([^\s]+)' , text_field ))
92
+
97
93
98
94
input_lookups = Lookup .mapNamesToSecurityContentObjects (list (inputLookupsToGet - LOOKUPS_TO_IGNORE ), director )
99
95
output_lookups = Lookup .mapNamesToSecurityContentObjects (list (outputLookupsToGet - LOOKUPS_TO_IGNORE ), director )
100
-
101
-
102
-
103
- my_lookups = Lookup .mapNamesToSecurityContentObjects (list (lookups_to_get - LOOKUPS_TO_IGNORE ), director )
96
+ lookups = Lookup .mapNamesToSecurityContentObjects (list (lookupsToGet - LOOKUPS_TO_IGNORE ), director )
104
97
105
98
106
99
107
- return my_lookups
100
+ return lookups + input_lookups + output_lookups
108
101
109
102
110
103
0 commit comments