def __init__(self, model_cls=None):
super(ModelResourceBase, self).__init__()<EOL>if not model_cls:<EOL><INDENT>self.model_cls = self.__model__<EOL><DEDENT>else:<EOL><INDENT>self.model_cls = model_cls<EOL><DEDENT>mapper = class_mapper(self.model_cls)<EOL>self._model_pk = mapper.primary_key[<NUM_LIT:0>]<EOL>self._model_columns = [column.key for column in mapper.column_attrs]<EOL>self._related_columns = [column.key for column in mapper.relationships]<EOL>
Create Model CRUD resource for ``model_cls``