Hello - need help on accessing current user in django forms.

43 views
Skip to first unread message

Naresh Kumar

unread,
Sep 23, 2016, 7:17:32 AM9/23/16
to Django users
Hello,

I need filter a queryset based on current user in Django forms.

kindly help me if you find any.

Thanks,

Naresh

Tim Graham

unread,
Sep 23, 2016, 8:44:38 AM9/23/16
to Django users
Try a web search for "django passing request to a form".

Here's the first result: http://stackoverflow.com/questions/6325681/passing-a-user-request-to-forms

Ricardo Daniel Quiroga

unread,
Sep 27, 2016, 9:00:23 AM9/27/16
to django...@googlegroups.com
HttpRequest.user

return the autenticated user in django

def miview(request):
     login_user = request.user
     ...
in case you have not logged in return None 





--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f98a65ca-57da-4ec7-a2f4-d2a79f3929d2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Ricardo Daniel Quiroga

Reply all
Reply to author
Forward
0 new messages