diff options
| author | James Rutherford | 2015-03-11 10:38:03 +0000 | 
|---|---|---|
| committer | James Rutherford | 2015-03-11 10:38:03 +0000 | 
| commit | 4a2d27975ab5249269aebafd803be87a2107092b (patch) | |
| tree | 55b524c93b02eef404304f734be98871bbb1324f /docs/api-guide/reverse.md | |
| parent | 856dc855c952746f566a6a8de263afe951362dfb (diff) | |
| parent | dc56e5a0f41fdd6350e91a5749023d086bd1640f (diff) | |
| download | django-rest-framework-4a2d27975ab5249269aebafd803be87a2107092b.tar.bz2 | |
Merge pull request #1 from tomchristie/master
Merge in from upstream
Diffstat (limited to 'docs/api-guide/reverse.md')
| -rw-r--r-- | docs/api-guide/reverse.md | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/docs/api-guide/reverse.md b/docs/api-guide/reverse.md index 19930dc3..71fb83f9 100644 --- a/docs/api-guide/reverse.md +++ b/docs/api-guide/reverse.md @@ -1,4 +1,4 @@ -<a class="github" href="reverse.py"></a> +source: reverse.py  # Returning URLs @@ -17,7 +17,7 @@ The advantages of doing so are:  REST framework provides two utility functions to make it more simple to return absolute URIs from your Web API. -There's no requirement for you to use them, but if you do then the self-describing API will be able to automatically hyperlink it's output for you, which makes browsing the API much easier. +There's no requirement for you to use them, but if you do then the self-describing API will be able to automatically hyperlink its output for you, which makes browsing the API much easier.  ## reverse @@ -27,13 +27,13 @@ Has the same behavior as [`django.core.urlresolvers.reverse`][reverse], except t  You should **include the request as a keyword argument** to the function, for example: -    import datetime      from rest_framework.reverse import reverse      from rest_framework.views import APIView -    +	from django.utils.timezone import now +  	class APIRootView(APIView):  	    def get(self, request): -	        year = datetime.datetime.now().year +	        year = now().year  			data = {   				...      		    'year-summary-url': reverse('year-summary', args=[year], request=request) | 
