Add a query dict argument to common.http.URL
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -127,6 +127,7 @@
|
||||
Fix passing the dynamic Meta class to the test model.
|
||||
- Support for proxy model permission inheritance. Proxy models
|
||||
now get the permission inheritance from their base models.
|
||||
- Update common.http.URL to allow passing a query dictionary.
|
||||
|
||||
3.2.9 (2019-11-03)
|
||||
==================
|
||||
|
||||
@@ -6,15 +6,20 @@ from django.utils.six import PY3
|
||||
|
||||
|
||||
class URL(object):
|
||||
def __init__(self, path=None, query_string=None):
|
||||
def __init__(self, path=None, query_string=None, query=None):
|
||||
self._path = path
|
||||
self._query_string = query_string
|
||||
self._query = query
|
||||
|
||||
kwargs = {'mutable': True}
|
||||
if query_string:
|
||||
kwargs['query_string'] = query_string.encode('utf-8')
|
||||
if self._query_string:
|
||||
kwargs['query_string'] = self._query_string.encode('utf-8')
|
||||
|
||||
self._args = QueryDict(**kwargs)
|
||||
|
||||
if self._query:
|
||||
self.args.update(self._query)
|
||||
|
||||
@property
|
||||
def args(self):
|
||||
return self._args
|
||||
|
||||
Reference in New Issue
Block a user