Skip to content

Commit 17ffca3

Browse files
Modify name to be more generic in context.
1 parent 06ac74e commit 17ffca3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

dj_gui_api_server/DJConnector.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,23 @@ def fetch_tuples(jwt_payload: dict, schema_name: str, table_name: str,
124124
:return: Records in dict form and the total number of records that can be paged
125125
:rtype: tuple
126126
"""
127-
def filter_to_restriction(filter_card: dict) -> str:
128-
if filter_card['operation'] in ('>', '<', '>=', '<='):
129-
operation = filter_card['operation']
130-
elif filter_card['value'] is None:
131-
operation = (' IS ' if filter_card['operation'] == '='
127+
def filter_to_restriction(attribute_filter: dict) -> str:
128+
if attribute_filter['operation'] in ('>', '<', '>=', '<='):
129+
operation = attribute_filter['operation']
130+
elif attribute_filter['value'] is None:
131+
operation = (' IS ' if attribute_filter['operation'] == '='
132132
else ' IS NOT ')
133133
else:
134-
operation = filter_card['operation']
134+
operation = attribute_filter['operation']
135135

136-
if (isinstance(filter_card['value'], str) and
137-
not filter_card['value'].isnumeric()):
138-
value = f"'{filter_card['value']}'"
136+
if (isinstance(attribute_filter['value'], str) and
137+
not attribute_filter['value'].isnumeric()):
138+
value = f"'{attribute_filter['value']}'"
139139
else:
140-
value = ('NULL' if filter_card['value'] is None
141-
else filter_card['value'])
140+
value = ('NULL' if attribute_filter['value'] is None
141+
else attribute_filter['value'])
142142

143-
return f"{filter_card['attributeName']}{operation}{value}"
143+
return f"{attribute_filter['attributeName']}{operation}{value}"
144144

145145
DJConnector.set_datajoint_config(jwt_payload)
146146

0 commit comments

Comments
 (0)