Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre-Yves David
swh-web
Commits
70508379
Commit
70508379
authored
7 years ago
by
Antoine Lambert
Browse files
Options
Downloads
Patches
Plain Diff
add missing docstring
parent
76afd4ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/api/utils.py
+20
-2
20 additions, 2 deletions
swh/web/api/utils.py
with
20 additions
and
2 deletions
swh/web/api/utils.py
+
20
−
2
View file @
70508379
...
...
@@ -17,8 +17,26 @@ from .exc import BadInputExc
# override django reverse function in order to get
# the same result on debian jessie and stretch
# (see https://code.djangoproject.com/ticket/22223)
def
reverse
(
viewname
,
urlconf
=
None
,
args
=
None
,
kwargs
=
None
,
current_app
=
None
,
query_params
=
None
):
def
reverse
(
viewname
,
args
=
None
,
kwargs
=
None
,
query_params
=
None
,
current_app
=
None
,
urlconf
=
None
):
"""
An override of django reverse function supporting multiple
django versions (from 1.7 to current) and query parameters.
Args:
viewname: the name of the django view from which to compute
a url
args: list of url arguments ordered according to their position it
kwargs: dictionnary of url arguments indexed by their names
query_params: dictionnary of query parameters to append to the
reversed url
current_app: the name of the django app tighted to the view
urlconf: url configuration module
Returns:
The url of the requested view with processed arguments and
query parameters
"""
url
=
urllib
.
parse
.
unquote
(
urlresolvers
.
reverse
(
viewname
,
urlconf
=
urlconf
,
args
=
args
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment