Created
May 21, 2015 13:14
-
-
Save d7my11/160708a9507c4cbcbdcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_url(self, endpoint): | |
"""Adds additional urls to the resource | |
:endpoint: the end point API to be added | |
:returns: the url created ( for tastypie ) | |
""" | |
api = r'(?P<resource_name>%s)/(?P<endpoint>%s)%s$' % ( | |
self._meta.resource_name, endpoint, trailing_slash()) | |
endpoint = endpoint.replace('/', '_') | |
return url(api, self.wrap_view(endpoint), name='api_%s' % endpoint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment