Answers for "how to get current user in models django"

-1

how to get user id django

def sample_view(request):
    current_user = request.user
    print current_user.id
Posted by: Guest on May-22-2020
0

django get current user in form

def __init__(self, user, *args, **kwargs):
    self.user = user
    super(RSVPForm, self).__init__(*args, **kwargs)
Posted by: Guest on July-18-2021

Code answers related to "how to get current user in models django"

Python Answers by Framework

Browse Popular Code Answers by Language