code: def as_dict(self):
          
          odict = OrderedDict()
          for name in self._order:
              attr_value = getattr(self, name)
              if isinstance(attr_value, List):
                  _list = []
                  for item in attr_value:
                      _list.append((item.as_dict() if isinstance(item, Entity) else item))
                      odict[name] = _list
              elif isinstance(attr_value, Entity):
                  odict[name] = attr_value.as_dict()
              else:
                  odict[name] = getattr(self, name)
          return odict
docs: create a dict based on class attributes