1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # settings.py
class InvalidVarException(object):
def __mod__(self, missing):
try:
missing_str=unicode(missing)
except:
missing_str='Failed to create string representation'
raise Exception('Unknown template variable %r %s' % (missing, missing_str))
def __contains__(self, search):
if search=='%s':
return True
return False
TEMPLATE_DEBUG=True
TEMPLATE_STRING_IF_INVALID = InvalidVarException()
|
More like this
- Safing HTML Text Input by PizzaPanther 3 years, 5 months ago
- Generic object_detail view with multiple named URL filters by cotton 5 months, 1 week ago
- safe(r) monkeypatching scheme for django testing by showell 2 years, 5 months ago
- Fix for the bad behaviour of GenericForeignKey field by pinkeen 1 year, 4 months ago
- Template tag to create a list from one or more variables and/or literals by davidchambers 1 year, 8 months ago
Comments
Related ticket: #6766
#