Missing templatetags

This commit is contained in:
Kumi 2022-10-29 17:05:17 +00:00
parent 63c257e68b
commit c8d90db687
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 9 additions and 0 deletions

View file

View file

@ -0,0 +1,9 @@
from django import template
from geopy.distance import geodesic
register = template.Library()
@register.simple_tag
def distance(pointa, pointb):
return geodesic((pointa.x, pointa.y), (pointb.x, pointb.y)).m