【发布时间】:2012-03-05 18:41:52
【问题描述】:
我有一个 django 应用程序,使用 django.contrib.auth.user 模型的基本 userprofile 扩展。我想在站点中添加“测试用户”,以允许个人查看站点但不影响其他用户(例如,出于演示目的)。
这就是它所需要的:
1 - Allow that user to do everything a 'normal' user could do
2 - Hide that user from all searches (or places where the user may be 'viewed' by other users)
在模型中实现这一点的好方法是什么? (我正在考虑设置user.is_active=False,但这样做时遇到了一些问题。)
【问题讨论】:
标签: python django database-design django-models