1 2 3 4 5 6 7 8 9 | from django import template
register = template.Library()
@register.filter
#capitalise the first letter of each sentence in a string
def capsentence(value):
value = value.lower()
return ". ".join([sentence.capitalize() for sentence in value.split(". ")])
|
More like this
- Name Capitalize Filter by hotani 4 years, 9 months ago
- Add validation for 'unique' and 'unique_together' constraints to newforms created dynamically via form_for_model or form_for_instance by mp 4 years, 8 months ago
- Username genrator by gustavo80br 3 years, 9 months ago
- Template tag to sort a list of links by pytechd 4 years, 5 months ago
- PseudoFieldManager by yeago 2 years, 10 months ago
Comments