之後升級到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 –