Missing templatetags
This commit is contained in:
parent
63c257e68b
commit
c8d90db687
2 changed files with 9 additions and 0 deletions
0
auction/templatetags/__init__.py
Normal file
0
auction/templatetags/__init__.py
Normal file
9
auction/templatetags/distance.py
Normal file
9
auction/templatetags/distance.py
Normal 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
|
Loading…
Reference in a new issue