admin.py 665 B

1234567891011121314151617
  1. from django.contrib import admin
  2. from django.contrib.gis.admin import OSMGeoAdmin
  3. from .models import *
  4. @admin.register(Marker)
  5. class MarkerAdmin(OSMGeoAdmin):
  6. list_display = ["timestamp", "location", "alt", "hdop", "speed"]
  7. @admin.register(Trip)
  8. class TripAdmin(admin.ModelAdmin):
  9. list_display = ["name", "description", "startTime", "totalTime", "color", "distance"]
  10. readonly_fields = ["path", "distance", "topSpeed", "avgSpeed", "ascendHeight", "descendHeight", "movementTime", "totalTime", "center", "line"]
  11. exclude = ["path"]
  12. @admin.register(CensoredLocation)
  13. class CensoredLocationAdmin(OSMGeoAdmin):
  14. list_display = ["name", "location", "radius"]