here is the full method (in comes from piston's code).
def cleanup_request(request):
"""
Removes `oauth_` keys from various dicts on the
request object, and returns the sanitized version.
"""
for method_type in ('GET', 'PUT', 'POST', 'DELETE'):
block = getattr(request, method_type, { })
if True in [ k.startswith("oauth_") for k in
block.keys() ]:
sanitized = block.copy()
for k in sanitized.keys():
if k.startswith("oauth_"):
sanitized.pop(k)
setattr(request, method_type, sanitized)
return request
The call blocks on method_type = "POST" if the request is a POST
request with an empty body.
-mehdi
On Jun 24, 12:51 am, Ivo Brodien <i...@brodien.de> wrote:
> On Jun 24, 2011, at 2:40 AM, mehdi ait oufkir wrote:
>
> > block = getattr(request, POST, { })
>
> shouldn't it be:
>
> block = getattr(request, 'POST', { }) ?
>
> What are you trying to do? Can you post the rest of the view function?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment