summaryrefslogtreecommitdiff
path: root/app/daily/admin.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-01-19 14:40:24 -0500
committerluxagraf <sng@luxagraf.net>2016-01-19 14:40:24 -0500
commit7622933e291141b5d58293eacb813d0c0635695f (patch)
tree0fd8afb12c8ff2f18a353104d2fa97be9c07c6fa /app/daily/admin.py
parent0879504bd5029b2a3b9e937cb4620c4cd3108459 (diff)
added my daily journal recording app, weather grabbing widget and
checkin model. Still need to add widget to checkin admin to automatically grab the geodata from device.
Diffstat (limited to 'app/daily/admin.py')
-rw-r--r--app/daily/admin.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/app/daily/admin.py b/app/daily/admin.py
new file mode 100644
index 0000000..210aabc
--- /dev/null
+++ b/app/daily/admin.py
@@ -0,0 +1,49 @@
+from django.contrib import admin
+from django import forms
+from django.contrib.gis.admin import OSMGeoAdmin
+
+from utils.widgets import AdminImageWidget, LGEntryForm
+from .models import CheckIn, Daily, Weather
+
+
+class WeatherAdmin(OSMGeoAdmin):
+ pass
+
+
+class DailyAdmin(OSMGeoAdmin):
+ form = LGEntryForm
+ fieldsets = (
+ (None, {
+ 'fields': (
+ 'title',
+ 'body_markdown',
+ 'weather_human',
+ )
+ }),
+ ('Details', {
+ 'fields': (
+ 'location',
+ 'weather',
+ 'date'
+ ),
+ 'classes': ('collapse',),
+ }),
+ )
+
+
+class CheckInAdmin(OSMGeoAdmin):
+ list_display = ('date', 'location')
+ default_lon = -9285175
+ default_lat = 4025046
+ default_zoom = 15
+ units = True
+ scrollable = False
+ map_width = 700
+ map_height = 425
+ map_template = 'gis/admin/osm.html'
+ openlayers_url = '/static/admin/js/OpenLayers.js'
+
+
+admin.site.register(CheckIn, CheckInAdmin)
+admin.site.register(Weather, WeatherAdmin)
+admin.site.register(Daily, DailyAdmin)