emitjson.py 文件源码

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

项目:emitjson 作者: atsuoishimoto 项目源码 文件源码
def _django_get_all_field_names(model):
    from itertools import chain
    from django.db.models import Manager
    from django.db.models.fields.related import ForeignObjectRel

    return list(set(chain.from_iterable(
        (field.name, field.attname) if hasattr(field, 'attname') else (field.name,)
        for field in model._meta.get_fields()
            if not isinstance(field, ForeignObjectRel)
    )))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号