Skip to content

Commit b02d351

Browse files
Update admin.py
1 parent f3997a3 commit b02d351

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

nearbyshops/shops/admin.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,14 @@
33
# Register your models here.
44

55
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
6+
from django.contrib.gis.admin import OSMGeoAdmin
97

108
from .models import Shop
11-
12-
user_location = fromstr('POINT(-9.544372557268286 30.35495327369988)', srid=4326)
139

1410
@admin.register(Shop)
1511
class ShopAdmin(OSMGeoAdmin):
1612
list_display= ('name','location')
1713

18-
def dist(self, obj):
19-
d = obj.location.distance(user_location)
20-
return d
21-
dist.short_description = 'Distance'
2214

2315

2416

0 commit comments

Comments
 (0)