__init__.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Canella-CMS 作者: mush42 项目源码 文件源码
def gen_default_api_endpoints(cls):
        e = engine()
        model_name = cls.schema.Meta.model.__name__.lower()
        identifier = e.plural(model_name)
        rv = {
            '/%s/' %identifier: {
                'endpoint': '%s-collection' %model_name,
                'methods': ['GET', 'POST']
            },
            '/%s/<int:pk>/' %identifier: {
                'endpoint': '%s-resource' %model_name,
                'methods': ['GET', 'PUT', 'DELETE']
            },
        }
        return rv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号