之后升级到1.3的Django(从1.2.3)后,以下行会导致系统崩溃:的Django 1.3:问题与用户配置升级
users = self.users.filter(userprofile__public_profile=True).order_by('first_name')
所示的错误:
Caught FieldError while rendering: Cannot resolve keyword 'userprofile' into field. Choices are: _message_set, comment, commentabusereport, date_joined, dialog, dialogabusereport, email, first_name, forums, groups, id, is_active, is_staff, is_superuser, last_login, last_name, logentry, password, registrationprofile, user_permissions, userassociation, username, vote
正如之前,该用户配置模型指定这样的:
AUTH_PROFILE_MODULE = 'emailuser.UserProfile'
有趣的事情,某些字段显示为菱(如“对话框幷gabusereport“和”userassociation“)反过来是与UserProfile中的用户关系具有相同用户关系的其他内部模型。
任何可能导致这种情况的想法?为什么Django不能在这个关系中看到我们的UserProfile模型?
有类似的问题,又回到Django的1.2.3和我的项目再次工作。希望我可以帮你解答 - 至少我可以为你的问题投票。 – golliher
您是否有机会从配置文件的应用程序models.py文件中的django.contrib.auth.admin导入UserAdmin?可能是由这个问题引起的:https://code.djangoproject.com/ticket/15771 –