From 9dd954bccde50d942173aaf861fdedb51a502e71 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Wed, 11 Jan 2017 16:55:34 -0600 Subject: [PATCH] Update request.form to work with __getitem__ --- sanic/request.py | 3 +++ tests/{tests_server_events.py => test_server_events.py} | 0 2 files changed, 3 insertions(+) rename tests/{tests_server_events.py => test_server_events.py} (100%) diff --git a/sanic/request.py b/sanic/request.py index 7ca5523c..5c4a7db4 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -25,6 +25,9 @@ class RequestParameters(dict): self.super = super() self.super.__init__(*args, **kwargs) + def __getitem__(self, name): + return self.get(name) + def get(self, name, default=None): values = self.super.get(name) return values[0] if values else default diff --git a/tests/tests_server_events.py b/tests/test_server_events.py similarity index 100% rename from tests/tests_server_events.py rename to tests/test_server_events.py