0

I have CustomUser class

class CustomUser(User):
    some_extra_field = models.CharField(max_length=30, blank=True)

Now in some view I get User instance as argument and inside this view I want to create CustomUser instance based on that argument.

Should I do this like this?

def view(user):
    custom_user = user
    custom_user.__class__ = CustomUser
4

1 回答 1

0

这个关于扩展用户模型的问题有帮助吗?

于 2012-08-09T06:41:07.600 回答