MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / _flatten_fields

Method _flatten_fields

botasaurus_server/botasaurus_server/views.py:127–136  ·  view source on GitHub ↗
(self, fields)

Source from the content-addressed store, hash-verified

125 }
126
127 def _flatten_fields(self, fields):
128 flat_list = []
129 for field in fields:
130 if isinstance(field, (Field, CustomField)):
131 # Wrap field.key in a dict with a 'key' attribute
132 flat_list.append({"key": field.output_key,})
133 elif isinstance(field, (ExpandDictField, ExpandListField)):
134 # Only add nested fields without adding the key of the ExpandDictField or ExpandListField itself
135 flat_list.extend(self._flatten_fields(field.fields))
136 return flat_list
137
138
139def created_nested_field_values(record, field):

Callers 1

to_jsonMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected