make an attribute named "user"
On Fri, Nov 13, 2020 at 2:27 PM Apolo Machine <apolomachine@gmail.com> wrote:
I'm trying to get the username within a view(CBV), the documentation I found says that the logged user is within the request, but when I doclass ServiceCreateView(LoginRequiredMixin, CreateView):model = Serviceform_class = ServiceFormuser=request.user.usernamei get this errorAttributeError: module 'django.http.request' has no attribute 'userany help is appreciated--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8635848c-b7fc-4b6b-9b53-f6107ce42717n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAcuwDfBL82t2WebGvYmUEiP%2BCD7tv3aBTL7f%2BrH0igzVUbSuQ%40mail.gmail.com.
No comments:
Post a Comment