/ registration / list /'str'对象上的AttributeError没有属性'get'

时间:2019-05-18 15:25:02

标签: django

template我正在尝试根据登录用户显示记录并收到AttributeError:“ str”对象的以下代码没有属性“ get”错误。有人可以告诉我如何解决吗?谢谢。

class ListRegistration(LoginRequiredMixin, FilterView):
    model = models.NewRegistration

    template_name = 'registration_list.html'
    context_object_name = 'registrations'
    paginate_by = 10

    def get_queryset(self):
      user_id=self.request.user.id
      profile_qs = Profile.objects.filter(id=user_id).values_list("user_id", flat=True)
      return models.NewRegistration.objects.filter(is_forwarded=False,user_id=user_id).order_by('-id')

0 个答案:

没有答案