def _column2field(
        self,
        datamodel: SQLAInterface,
        column: TreeNode,
        nested: bool = True,
        parent_schema_name: Optional[str] = None,
    ) -> Field:
        """

        :param datamodel: SQLAInterface
        :param column: TreeNode column (childs are dotted columns)
        :param nested: Boolean if will create nested fields
        :return: Schema.field
        """
        # Handle relations
        if datamodel.is_relation(column.name):
            return self._column2relation(
                datamodel, column, nested=nested, parent_schema_name=parent_schema_name
            )
        # Handle Enums
        if datamodel.is_enum(column.name):
            return self._column2enum(datamodel, column)
        # is custom property method field?
        if hasattr(getattr(datamodel.obj, column.name), "fget"):
            return fields.Raw(dump_only=True)
        # its a model function
        if hasattr(getattr(datamodel.obj, column.name), "__call__"):
            return fields.Function(getattr(datamodel.obj, column.name), dump_only=True)
        # is a normal model field not a function?
        if not hasattr(getattr(datamodel.obj, column.name), "__call__"):
            field = field_for(datamodel.obj, column.name)
            field.unique = datamodel.is_unique(column.name)
            if column.name in self.validators_columns:
                if field.validate is None:
                    field.validate = []
                field.validate.append(self.validators_columns[column.name])
                field.validators.append(self.validators_columns[column.name])
            return field


        :param datamodel: SQLAInterface
        :param column: TreeNode column (childs are dotted columns)
        :param nested: Boolean if will create nested fields
        :return: Schema.field
        
flask_appbuilder/api/convert.py