Merge pull request #289 from seemethere/update_request_form_getitem
Update request.form to work with __getitem__
This commit is contained in:
commit
cf60ebd988
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user