folderadmin.py 文件源码

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

项目:ecs_sclm 作者: meaningful 项目源码 文件源码
def owner_search_fields(self):
        """
        Returns all the fields that are CharFields except for password from the
        User model.  For the built-in User model, that means username,
        first_name, last_name, and email.
        """
        try:
            from django.contrib.auth import get_user_model
        except ImportError:  # Django < 1.5
            from django.contrib.auth.models import User
        else:
            User = get_user_model()
        return [
            field.name for field in User._meta.fields
            if isinstance(field, models.CharField) and field.name != 'password'
        ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号