Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
a5213d40
Commit
a5213d40
authored
Sep 14, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop urlobject2
parent
a2d0fd2c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
README.md
+0
-1
djangorestframework/templatetags/add_query_param.py
+12
-2
docs/index.md
+0
-1
setup.py
+1
-1
No files found.
README.md
View file @
a5213d40
...
@@ -16,7 +16,6 @@ For more information, check out [the documentation][docs], in particular, the tu
...
@@ -16,7 +16,6 @@ For more information, check out [the documentation][docs], in particular, the tu
*
Python (2.6, 2.7)
*
Python (2.6, 2.7)
*
Django (1.3, 1.4, 1.5)
*
Django (1.3, 1.4, 1.5)
*
[
URLObject
][
urlobject
]
(2.0.0+)
**Optional:**
**Optional:**
...
...
djangorestframework/templatetags/add_query_param.py
View file @
a5213d40
from
django.http
import
QueryDict
from
django.template
import
Library
from
django.template
import
Library
from
url
object
import
URLObject
from
url
parse
import
urlparse
,
urlunparse
register
=
Library
()
register
=
Library
()
def
replace_query_param
(
url
,
key
,
val
):
(
scheme
,
netloc
,
path
,
params
,
query
,
fragment
)
=
urlparse
(
url
)
query_dict
=
QueryDict
(
query
)
.
copy
()
query_dict
[
key
]
=
val
query
=
query_dict
.
urlencode
()
return
urlunparse
((
scheme
,
netloc
,
path
,
params
,
query
,
fragment
))
def
add_query_param
(
url
,
param
):
def
add_query_param
(
url
,
param
):
return
unicode
(
URLObject
(
url
)
.
with_query
(
param
))
key
,
val
=
param
.
split
(
'='
)
return
replace_query_param
(
url
,
key
,
val
)
register
.
filter
(
'add_query_param'
,
add_query_param
)
register
.
filter
(
'add_query_param'
,
add_query_param
)
docs/index.md
View file @
a5213d40
...
@@ -17,7 +17,6 @@ REST framework requires the following:
...
@@ -17,7 +17,6 @@ REST framework requires the following:
*
Python (2.6, 2.7)
*
Python (2.6, 2.7)
*
Django (1.3, 1.4, 1.5)
*
Django (1.3, 1.4, 1.5)
*
[
URLObject
][
urlobject
]
(2.0.0+)
The following packages are optional:
The following packages are optional:
...
...
setup.py
View file @
a5213d40
...
@@ -63,7 +63,7 @@ setup(
...
@@ -63,7 +63,7 @@ setup(
packages
=
get_packages
(
'djangorestframework'
),
packages
=
get_packages
(
'djangorestframework'
),
package_data
=
get_package_data
(
'djangorestframework'
),
package_data
=
get_package_data
(
'djangorestframework'
),
test_suite
=
'djangorestframework.runtests.runcoverage.main'
,
test_suite
=
'djangorestframework.runtests.runcoverage.main'
,
install_requires
=
[
'URLObject>=0.6.0'
],
install_requires
=
[],
classifiers
=
[
classifiers
=
[
'Development Status :: 4 - Beta'
,
'Development Status :: 4 - Beta'
,
'Environment :: Web Environment'
,
'Environment :: Web Environment'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment