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 1 year, 6 months ago
  2. Filter by taggit tags in the admin by flupke 7 months, 2 weeks ago
  3. math filter by itchyfingrs 1 year, 1 month ago
  4. Filter by first letter inclusion tag by slafs 2 years ago
  5. Filter for adding quote marks by olau 4 years, 6 months 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?)