Django admin 外键关联默认显示用户的username
使用默认User表.默认显示用户username,转换成get_full_name()
/home/labsmith/venv_labsmit/lib/python3.6/site-packages/django/contrib/auth/models.py
class User(AbstractUser):
"""
Users within the Django authentication system are represented by this
model.
Username and password are required. Other fields are optional.
"""
def __str__(self):
return self.get_full_name()
class Meta(AbstractUser.Meta):
swappable = 'AUTH_USER_MODEL'
添加 str 方法
暂时没发现异常,有异常在更新
I can feel you forgetting me。。
有一种默契叫做我不理你,你就不理我