Using a decorator I was trying to add a method to WSGIRequest request, just like is_ajax().
Since I could not find a proper way I just updated request.META with the info needed.
Should I look into adding method at runtime in Python ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try to write custom middleware and add this method to request during request process.
See this for more info how to write middleware:
http://docs.djangoproject.com/en/dev/topics/http/middleware/#writing-your-own-middleware
http://www.djangobook.com/en/beta/chapter16/