From b78d25106d99404f08cde8ff337a7970470ecd17 Mon Sep 17 00:00:00 2001 From: Keiran Price Date: Thu, 24 Oct 2019 10:25:29 +0100 Subject: [PATCH] #105: Use method --- common/models/db_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/models/db_models.py b/common/models/db_models.py index 223709c4..23b45696 100644 --- a/common/models/db_models.py +++ b/common/models/db_models.py @@ -52,7 +52,7 @@ def to_dict(self): dictionary = {} for column in self.__table__.columns: attribute = getattr(self, column.name) - dictionary[column.name] = str(attribute) if isinstance(attribute, datetime) else attribute + dictionary[column.name] = self._make_serializable(attribute) return dictionary def _make_serializable(self, field):