Created
October 27, 2015 09:56
-
-
Save mhipo1364/4b798654cce0675d8179 to your computer and use it in GitHub Desktop.
This static method generate proper url via given parameters
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
@staticmethod | |
def _generate_url(**kwrgs): | |
""" | |
This static method generate proper url via given parameters | |
:param kwrgs: | |
:return: string | |
""" | |
url = settings['CUSTOM_BASE_URL'] + '/{}?'.format(kwrgs.pop('uri')) | |
for idx, (key, value) in enumerate(kwrgs.items()): | |
if idx: | |
url += '&' | |
url += '{}={}'.format(key, value) | |
return url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment