1 2 3 4 5 6 7 8 9 10 11 12 | from django.template.defaultfilters import stringfilter
from django.template.defaulttags import register
@stringfilter
@register.filter
def assert_period(str):
"""Makes sure a string ends with a period."""
if str[-1].isalnum():
return "%s." % str
else:
return str
|
More like this
- Sophisticated order_by sorting by mawi 5 months, 1 week ago
- "Zoom in" on rendered HTML that the test client returns by peterbe 4 years, 1 month ago
- Fuzzy Time of Day by waylan 5 years, 11 months ago
- Create multiple related objects at once by yaniv.haber 4 years, 1 month ago
- CSVImport by sharkus 4 years, 11 months ago
Comments