code: def fields_to_dict(self):
          
          d = {}
          for container in FieldsContainer.class_container.values():
              fields = getattr(self, container)
              if fields:
                  d[container] = [field.to_dict() for field in fields]
          return d
docs: Transform the object to a dict and return the dict.