We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3997a3 commit b02d351Copy full SHA for b02d351
1 file changed
nearbyshops/shops/admin.py
@@ -3,22 +3,14 @@
3
# Register your models here.
4
5
from django.contrib import admin
6
-from django.contrib.gis.admin import GeoModelAdmin, OSMGeoAdmin
7
-from django.contrib.gis.geos import fromstr
8
-from django.contrib.gis.db.models.functions import Distance
+from django.contrib.gis.admin import OSMGeoAdmin
9
10
from .models import Shop
11
-
12
-user_location = fromstr('POINT(-9.544372557268286 30.35495327369988)', srid=4326)
13
14
@admin.register(Shop)
15
class ShopAdmin(OSMGeoAdmin):
16
list_display= ('name','location')
17
18
- def dist(self, obj):
19
- d = obj.location.distance(user_location)
20
- return d
21
- dist.short_description = 'Distance'
22
23
24
0 commit comments