X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2common%2Fdomain%2Fbase.py;fp=o2common%2Fdomain%2Fbase.py;h=f419f23019123cd7eba86996cf8d1741e0073f65;hb=9ee90ffa2414326c26fd10edc59bf315204254e2;hp=e56672b89a13afcb4fd3c359fb275c5ce13a43a4;hpb=7c167626f2692556b1fe073f87150f54a8c9910a;p=pti%2Fo2.git diff --git a/o2common/domain/base.py b/o2common/domain/base.py index e56672b..f419f23 100644 --- a/o2common/domain/base.py +++ b/o2common/domain/base.py @@ -39,13 +39,13 @@ class Serializer(object): def serialize(self): try: - # d = {c: getattr(self, c) for c in inspect(self).attrs.keys()} - # if 'createtime' in d: - # d['createtime'] = d['createtime'].isoformat() - # if 'updatetime' in d: - # d['updatetime'] = d['updatetime'].isoformat() - # return d - return {c: getattr(self, c) for c in inspect(self).attrs.keys()} + d = {c: getattr(self, c) for c in inspect(self).attrs.keys()} + if 'createtime' in d: + d['createtime'] = d['createtime'].isoformat() + if 'updatetime' in d: + d['updatetime'] = d['updatetime'].isoformat() + return d + # return {c: getattr(self, c) for c in inspect(self).attrs.keys()} except NoInspectionAvailable: return self.__dict__