code: def field_to_dict(self, field):
          
          value = getattr(self, field)
          if isinstance(value, (list, tuple)):
              return [self.value_to_dict(val) for val in value]
          return self.value_to_dict(value)
docs: Read field value and converts to dict if possible