diff --git a/auction/templatetags/__init__.py b/auction/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/auction/templatetags/distance.py b/auction/templatetags/distance.py new file mode 100644 index 0000000..e3d1fef --- /dev/null +++ b/auction/templatetags/distance.py @@ -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