Django不同的用户类型扩展默认用户类型

时间:2015-03-09 17:40:23

标签: python django django-models django-users python-social-auth

我是Django的新手。

在我的项目中,我需要有两种不同的用户类型:

  • User_type_1:包含一些自定义字段;
  • User_type_2:包含一些自定义字段(与User_type_1不同);

User_type_1和User_type_2有一些共同的字段(用户名,密码,...)我想维护Django Standard用户,如Type_1和Type_2父类型。我想得到这样的东西:

Django Standard User (name, username, password...)
|
|_ User_type_1 (type_1 custom field 1,....custom field N)
|_ User_type_2 (type_2 custom field 1,....custom field N)

因此,在User_type_1中,我还会找到从父亲那里继承的姓名,用户名和密码。

在下一步中,我想使用python_social_auth进行身份验证,仅适用于Facebook,仅适用于User_type_1。 User_type_2可以继续通过用户名/密码登录(使用用户的Django经典方法)。

有可能知道这样做的最佳做法吗?

可以为我的案例(不同的用户类型)找到一些示例/教程

0 个答案:

没有答案