Update request.form to work with __getitem__

This commit is contained in:
Eli Uriegas 2017-01-11 16:55:34 -06:00
parent a02eb8e7cb
commit 9dd954bccd
2 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@ class RequestParameters(dict):
self.super = super() self.super = super()
self.super.__init__(*args, **kwargs) self.super.__init__(*args, **kwargs)
def __getitem__(self, name):
return self.get(name)
def get(self, name, default=None): def get(self, name, default=None):
values = self.super.get(name) values = self.super.get(name)
return values[0] if values else default return values[0] if values else default