Decorator Overwriting Post, Get And Request In Django - Doing It Right?
Solution 1:
If you're using a form, you could do the lowercase in the form itself.
While the implementation works IMO, I have a problem that for every single call, you end up copying the get/post dictionaries, searching through them, converting the fields and appending the result back as request._request
which you need to know about to be able to use it. I think it's a bit of overkill...
I'd change it with a simple method called in the view (depending on your situation, you can either overwrite the original values with the lowercase ones or create new elements).
Another solution can be to do it in the HTML page via javascript. You can either (hard)code the template, create a custom widget, or use something like an attribute specified in the widget plus a jquery call...
Post a Comment for "Decorator Overwriting Post, Get And Request In Django - Doing It Right?"