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
- urlquote() and urlencode() in one method by guettli 4 years, 7 months ago
- Non-pickling locmem (in-process memory) cache backend by akaihola 2 years, 3 months ago
- Complex Form Preview by smagala 4 years, 2 months ago
- Template filter implementing the Trac wiki markup language by simon 4 years, 9 months ago
- Pass db.Field to newforms.Widget by guettli 5 years, 11 months ago
Comments
Related ticket: #6766
#