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. Changelist filter by ForeignKey by overclocked 3 years, 5 months ago
  2. Filter by taggit tags in the admin by flupke 2 years, 6 months ago
  3. linebreaksli template filter by rokclimb15 6 years, 10 months ago
  4. Use MEDIA_URL in flatpages by robhudson 6 years ago
  5. math filter by itchyfingrs 3 years 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?)