admin.py 636 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", "endTime", "color", "distance", "topSpeed", "avgSpeed"]
  10. readonly_fields = ["path", "distance", "topSpeed", "avgSpeed", "ascendHeight", "descendHeight", "movementTime"]
  11. @admin.register(CensoredLocation)
  12. class CensoredLocationAdmin(OSMGeoAdmin):
  13. list_display = ["name", "location", "radius"]