Update request.form to work with __getitem__
This commit is contained in:
parent
a02eb8e7cb
commit
9dd954bccd
|
@ -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