'Use the registered viewsets to generate a list of URL patterns.'

def get_urls(self):

    ret = []
    for (prefix, viewset, basename) in self.registry:
        lookup = self.get_lookup_regex(viewset)
        routes = self.get_routes(viewset)
        for route in routes:
            mapping = self.get_method_map(viewset, route.mapping)
            if (not mapping):
                continue
            regex = route.url.format(prefix=prefix, lookup=lookup, trailing_slash=self.trailing_slash)
            if ((not prefix) and (regex[:2] == u'^/')):
                regex = (u'^' + regex[2:])
            view = viewset.as_view(mapping, **route.initkwargs)
            name = route.name.format(basename=basename)
            ret.append(url(regex, view, name=name))
    return ret
