【发布时间】:2012-10-23 18:18:49
【问题描述】:
以下是获取具有相关个人资料的用户的方法:Django: Difference between User.objects.profile.all() and User.objects.get_profile()?
但是这个例子使用的是用户 ID。我想通过 UserProfile 对象中的activation_key 获取用户,我尝试类似:
UserProfile.objects.select_related('user').get(activation_key=key)
但我得到了:
UserProfile 匹配查询不存在。
【问题讨论】:
-
你确定有
activation_key=key的UserProfile吗?
标签: django django-models django-authentication