1 2 3 4 5 6 7 8 9 10 | import re
from django import template
register = template.Library()
@register.filter
def match(value, regex):
"""Usage: {% if value|match:"regex" %}"""
return re.match(regex, value)
|
More like this
- location context_processor by gsf0 3 years, 9 months ago
- Single Django App behind multiple Apache Proxies by chadmaine 6 years ago
- Slightly better media path tag by ubernostrum 6 years, 1 month ago
- simple string formatting filter by gsf0 5 years, 8 months ago
- Flatpage Suggester Template tag for 404 templates by bradmontgomery 3 years, 3 months ago
Comments