Przeglądaj źródła

add admin interface

subDesTagesMitExtraKaese 2 lat temu
rodzic
commit
84e06f4637
2 zmienionych plików z 15 dodań i 2 usunięć
  1. 13 1
      admin.py
  2. 2 1
      models.py

+ 13 - 1
admin.py

@@ -1,3 +1,15 @@
 from django.contrib import admin
 
-# Register your models here.
+from .models import *
+
+@admin.register(Marker)
+class MarkerAdmin(admin.ModelAdmin):
+  list_display = ["timestamp", "lat", "lng", "alt", "hdop", "speed"]
+
+@admin.register(Trip)
+class TripAdmin(admin.ModelAdmin):
+  list_display = ["startTime", "endTime", "name", "description"]
+
+@admin.register(CensoredLocation)
+class CensoredLocationAdmin(admin.ModelAdmin):
+  list_display = ["lat", "lng", "radius", "name"]

+ 2 - 1
models.py

@@ -11,10 +11,11 @@ class Marker(models.Model):
 class Trip(models.Model):
   startTime = models.DateTimeField()
   endTime = models.DateTimeField()
-  location = models.CharField(max_length=255)
+  name = models.CharField(max_length=255)
   description = models.TextField(null=True, blank=True)
 
 class CensoredLocation(models.Model):
   lat = models.FloatField()
   lng = models.FloatField()
+  radius = models.IntegerField(default=800)
   name = models.CharField(max_length=255)