Created
April 14, 2011 21:05
-
-
Save prestontimmons/920546 to your computer and use it in GitHub Desktop.
Matching template variables in Django
This file contains hidden or 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
try: | |
variable_name = re.search("as (\w+)", token.contents).group(1) | |
except AttributeError: | |
raise template.TemplateSyntaxError, \ | |
"%r tag had invalid arguments." % token.split_contents()[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment