How would I pass a user object or a request to my form for validation?
For example, I want to be able to do something like this —
class Form(forms.Form):
...
def clean(self)
user = request.user # how to get request.user here?
user = User # how to pass the actual User object?
Thank you.
Just pass it into the constructor and store it as an instance variable:
In your view:
And if using a class-based view (a CreateView in this example):