code: def to_dict(self, include_readonly=True, field_names=None):
          '''
          Returns the instance's column values as a dict.
  
          - `include_readonly`: if false, returns only fields that can be inserted into database.
          - `field_names`: an iterable of field names to return (optional)
          '''
          fields = self.fields(writable=not include_readonly)
  
          if field_names is not None:
              fields = [f for f in fields if f in field_names]
  
          data = self.__dict__
          return {name: data[name] for name in fieldsf to_dict(self, include_readonly=True, field_names=None):
          '''
          Returns the instance's column values as a dict.
  
          - `include_readonly`: if false, returns only fields that can be inserted into database.
          - `field_names`: an iterable of field names to return (optional)
          '''
          fields = self.fields(writable=not include_readonly)
  
          if field_names is not None:
              fields = [f for f in fields if f in field_names]
  
          data = self.__dict__
          return {name: data[name] for name in fields}
docs: Returns the instance's column values as a dict.
  
          - `include_readonly`: if false, returns only fields that can be inserted into database.
          - `field_names`: an iterable of field names to return (optional)