def convert(self, columns, model=None, nested=True, enum_dump_by_name=False):
super(Model2SchemaConverter, self).convert(<EOL>columns,<EOL>model=model,<EOL>nested=nested<EOL>)<EOL>class SchemaMixin:<EOL><INDENT>pass<EOL><DEDENT>_model = model or self.datamodel.obj<EOL>_datamodel = self.datamodel.__class__(_model)<EOL>ma_sqla_fields_override = {}<EOL>_columns = list()<EOL>tree_columns = columns2Tree(columns)<EOL>for column in tree_columns.root.childs:<EOL><INDENT>ma_sqla_fields_override[column.data] = self._column2field(<EOL>_datamodel,<EOL>column,<EOL>nested,<EOL>enum_dump_by_name<EOL>)<EOL>_columns.append(column.data)<EOL><DEDENT>for k, v in ma_sqla_fields_override.items():<EOL><INDENT>setattr(SchemaMixin, k, v)<EOL><DEDENT>return self._meta_schema_factory(_columns, _model, SchemaMixin)()<EOL>
Creates a Marshmallow ModelSchema class


:param columns: List with columns to include, if empty converts all on model
:param model: Override Model to convert
:param nested: Generate relation with nested schemas
:return: ModelSchema object