SmartyPants Filter

1
2
3
4
5
6
7
@register.filter
def smartypants(value):
	try:
		import smartypants
		return smartypants.smartyPants(value)
	except:
		return value

More like this

  1. Really simple locking by sirex 2 years, 3 months ago
  2. Avoid widows using a template filter by jcroft 6 years, 2 months ago
  3. Wrappable text by jdunck 3 years, 7 months ago
  4. Pygmentify a code using template filter by tamizhgeek 2 years ago
  5. Simple template tag to do |stringformat filter with format from a variable by leopd 2 years, 1 month ago

Comments

pbx (on May 5, 2007):

An "except ImportError" would be better form there, assuming that the intent of the bare except is to handle cases where smartypants is not available.

#

(Forgotten your password?)