0👍
✅
It’s not that easy…
- Make a copy of the
admin/index.html
template to your
template/admin/index.html
- Create your own template filter:
lowerfirst_if_starts_with_v
in your
owntemplatetags/my_special_thing.py
directory
@register.filter(is_safe=True)
@stringfilter
def lowerfirst_if_starts_with_v(value):
"""Lowercase the first character of the value."""
return value and value[0] =='v' and value[0].lower() + value[1:]
- Load it in the
index.html
{%load my_special_thing%}
- Apply it to
index.html
on line23
<th scope="row"><a href="{{ model.admin_url }}"> \
{{ model.name|lowerfirst_if_starts_with_v }}</a></th>
And done.
Source:stackexchange.com