Create subtract filter.
This commit is contained in:
parent
5c4cc1e2e1
commit
99d3325e33
2 changed files with 7 additions and 0 deletions
6
www/conservancy/apps/news/templatetags/subtract.py
Normal file
6
www/conservancy/apps/news/templatetags/subtract.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django import template
|
||||
register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def subtract(value, arg):
|
||||
return value - arg
|
|
@ -1,4 +1,5 @@
|
|||
{% load humanize %}
|
||||
{% load subtract %}
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
|
|
Loading…
Reference in a new issue