Implementing multiple user types with Django 1.5

后端 未结 4 1504
挽巷
挽巷 2020-12-07 11:25

What is the recommended way to implement multiple user types using Django 1.5\'s new configurable user model functionality?

I would like to have two user types: priv

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 12:29

    I'd use a single model with a "type" attribute. Here is why:

    • Only one table, only one model
    • If you want to convert from one type to another you just change attribute
    • Implement getters and setters for the fields that exists for one type and doesn't exists for other = much more simple to use.

提交回复
热议问题