So it turns out you can simply use gadjo's get_request() to acquire the request objects instead of passing it along as parameters in your functions.
Now whenever you are in any function, and you need the request object, you can simply do..
and inside your function..
Now whenever you are in any function, and you need the request object, you can simply do..
from gadjo.requestprovider.signals import get_request
and inside your function..
def thisfunctionneedsrequest():
<variable-name> = get_request()
...
user = <variable-name>.user
So you don't need to keep passing the request object down to functions anymore. This makes things much easier.
No comments:
Post a Comment