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