models.py 文件源码

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

项目:omni-forms 作者: omni-digital 项目源码 文件源码
def get_model_fields(self):
        """
        Method to get all model fields for the content type
        associated with the forms specified content type

        :return: List of model field instances
        """

        def is_valid_field(field):
            if isinstance(field, (models.AutoField, ForeignObjectRel, GenericRelation, GenericForeignKey)):
                return False
            else:
                return True
        return list(filter(is_valid_field, self.content_type.model_class()._meta.get_fields()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号