def register(self, cls_list):
        for cls in cls_list:
            serializable_model = type(
                cls.__name__ + 'Serializable',
                (cls, SerializableModel),
                {})

            service = ReadService if self.readonly else WriteService

            new_endpoint = type(
                cls.__name__ + 'Endpoint',
                (service,),
                {'__model__': serializable_model,
                 '__db__': self.db})
            view_func = new_endpoint.as_view(
                new_endpoint.__model__.__tablename__)
            self.blueprint.add_url_rule(
                '/' + new_endpoint.__model__.__tablename__,
                defaults={'resource_id': None},
                view_func=view_func)
            self.blueprint.add_url_rule(
                '/{resource}/<resource_id>'.format(
                    resource=new_endpoint.__model__.__tablename__),
                view_func=view_func)
Register a class to be given a REST API.
dataset/ETHPy150Open jeffknupp/flask_sandboy/flask_sandboy/__init__.py/Sandboy.register