'Handles generating a resource URI.
If the ``bundle_or_obj`` argument is not provided, it builds the URI
for the list endpoint.
If the ``bundle_or_obj`` argument is provided, it builds the URI for
the detail endpoint.
Return the generated URI. If that URI can not be reversed (not found
in the URLconf), it will return an empty string.'

def get_resource_uri(self, bundle_or_obj=None, url_name=u'api_dispatch_list'):

    if (bundle_or_obj is not None):
        url_name = u'api_dispatch_detail'
    try:
        return self._build_reverse_url(url_name, kwargs=self.resource_uri_kwargs(bundle_or_obj))
    except NoReverseMatch:
        return u''
