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
- Changelist filter by ForeignKey by overclocked 1 year, 2 months ago
- Filter by taggit tags in the admin by flupke 3 months, 4 weeks ago
- math filter by itchyfingrs 10 months ago
- Filter by first letter inclusion tag by slafs 1 year, 8 months ago
- Template filter to turn Twitter names into links by mrben_ 1 year, 6 months ago
Comments
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.
#