From 3d4bb4b5533fa281c2f11c12ceb0a9ae61aa0d54 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 21 Jun 2013 22:03:07 +0100 Subject: Ensure action kwargs properly handdled. Refs #940. --- htmlcov/rest_framework_reverse.html | 127 ++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 htmlcov/rest_framework_reverse.html (limited to 'htmlcov/rest_framework_reverse.html') diff --git a/htmlcov/rest_framework_reverse.html b/htmlcov/rest_framework_reverse.html new file mode 100644 index 00000000..4e7a8de2 --- /dev/null +++ b/htmlcov/rest_framework_reverse.html @@ -0,0 +1,127 @@ + + + + + + + + Coverage for rest_framework/reverse: 75% + + + + + + + + + + + +
+ +

Hot-keys on this page

+
+

+ r + m + x + p   toggle line displays +

+

+ j + k   next/prev highlighted chunk +

+

+ 0   (zero) top of page +

+

+ 1   (one) first highlighted chunk +

+
+
+ +
+ + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+

11

+

12

+

13

+

14

+

15

+

16

+

17

+

18

+

19

+

20

+

21

+

22

+

23

+ +
+

""" 

+

Provide reverse functions that return fully qualified URLs 

+

""" 

+

from __future__ import unicode_literals 

+

from django.core.urlresolvers import reverse as django_reverse 

+

from django.utils.functional import lazy 

+

 

+

 

+

def reverse(viewname, args=None, kwargs=None, request=None, format=None, **extra): 

+

    """ 

+

    Same as `django.core.urlresolvers.reverse`, but optionally takes a request 

+

    and returns a fully qualified URL, using the request to get the base URL. 

+

    """ 

+

    if format is not None: 

+

        kwargs = kwargs or {} 

+

        kwargs['format'] = format 

+

    url = django_reverse(viewname, args=args, kwargs=kwargs, **extra) 

+

    if request: 

+

        return request.build_absolute_uri(url) 

+

    return url 

+

 

+

 

+

reverse_lazy = lazy(reverse, str) 

+ +
+
+ + + + + -- cgit v1.2.3