summaryrefslogtreecommitdiff
path: root/app/birds/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/birds/admin.py')
-rw-r--r--app/birds/admin.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/birds/admin.py b/app/birds/admin.py
index ef394d9..e70f9db 100644
--- a/app/birds/admin.py
+++ b/app/birds/admin.py
@@ -4,6 +4,7 @@ from birds.models import BirdSighting, BirdAudio, BirdClass, Bird
from django.contrib.gis.geos import GEOSGeometry
from photos.forms import GalleryForm
+from daily.models import CheckIn
def convertll(lat, lon):
@@ -12,10 +13,10 @@ def convertll(lat, lon):
return pnt.y, pnt.x
-# Florida: lat, lon = convertll(29.658057, -84.867797)
-# Athens:
-lon = -9285175
-lat = 4025046
+def get_latlon():
+ loc = CheckIn.objects.latest()
+ lat_converted, lon_converted = convertll(loc.lat, loc.lon)
+ return lat_converted, lon_converted
class BirdClassAdmin(admin.ModelAdmin):
@@ -54,6 +55,8 @@ class BirdSightingAdmin(OSMGeoAdmin):
),
)
# options for OSM map Using custom ESRI topo map
+ lat, lon = get_latlon()
+ print(lat, lon)
default_lon = lon
default_lat = lat
default_zoom = 13