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
from django import template | |
def __is_quoted(str): | |
return (str[0] == str[-1] and str[0] in ('"', "'")) | |
def __process_quoted(tag_name, str): | |
if not __is_quoted(str): | |
raise template.TemplateSyntaxError("%r tag's argument %s should be in quotes" % (tag_name, str)) | |
return str[1:-1] |