From 542af381c9fd63129c3eb675105de516da8b65ae Mon Sep 17 00:00:00 2001 From: Andrew Duckett Date: Mon, 14 Oct 2024 17:09:47 -0500 Subject: [PATCH] fix serialize all to use positional arguments --- pysnc/record.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pysnc/record.py b/pysnc/record.py index b8a8fe1..86d1c3c 100644 --- a/pysnc/record.py +++ b/pysnc/record.py @@ -31,9 +31,10 @@ def __init__(self, name: str, value=None, display_value=None, parent_record=None self._changed = False self._link = None if isinstance(value, dict): - self._value = value['value'] + if 'value' in value: + self._value = value['value'] # only bother to set display value if it's different - if self._value != value['display_value']: + if 'display_value' in value and self._value != value['display_value']: self._display_value = value['display_value'] if 'link' in value: self._link = value['link'] @@ -1090,7 +1091,7 @@ def serialize_all(self, display_value=False, fields=None, fmt=None, exclude_refe :param fmt: :return: list """ - return [record.serialize(display_value, fields, fmt, exclude_reference_link) for record in self] + return [record.serialize(display_value=display_value, fields=fields, fmd=fmt, exclude_reference_link=exclude_reference_link) for record in self] def to_pandas(self, columns=None, mode='smart'): """