utils.py 文件源码

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

项目:wagtail-pg-search-backend 作者: wagtail 项目源码 文件源码
def get_descendant_models(model):
    """
    Returns all descendants of a model, including the model itself.
    """
    descendant_models = {other_model for other_model in apps.get_models()
                         if issubclass(other_model, model)}
    descendant_models.add(model)
    return descendant_models
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号