Created
July 23, 2010 08:32
-
-
Save shylent/487174 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 handle_foo(request): | |
format_handlers = { | |
'xml':handle_foo_xml | |
} | |
format = request.GET.get('format', None) | |
if format is not None and format in format_handlers: | |
return format_handlers[format](request) | |
... | |
def handle_foo_xml(request): | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment