【问题标题】:Django - Why subclassing auth.User is not recommended for additional information? [duplicate]Django - 为什么不推荐子类化 auth.User 以获得更多信息? [复制]
【发布时间】:2011-09-17 21:50:02
【问题描述】:

可能重复:
Django: Why create a OneToOne to UserProfile instead of subclassing auth.User?

为什么不推荐使用子类化 auth.User 来获取有关用户 (auth.User) 的其他信息,而是 creating a UserProfile?

【问题讨论】:

    标签: django


    【解决方案1】:

    我认为这与recommended django way 没有太大区别,因为模型的子类在内部也会通过OneToOneField 连接到父类!

    【讨论】:

      猜你喜欢
      • 2011-07-24
      • 2015-09-02
      • 2013-08-02
      • 2021-09-12
      • 2015-05-13
      • 1970-01-01
      • 1970-01-01
      • 2012-01-08
      相关资源
      最近更新 更多