diff options
author | luxagraf <sng@luxagraf.net> | 2017-12-14 18:47:45 -0800 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2017-12-14 18:47:45 -0800 |
commit | 83b7318a4672d32ed77cd3f906f43f5ad1cce854 (patch) | |
tree | 457806693c791360ada99dd9b3d19a5dc9712936 /app/daily/admin.py | |
parent | adb5c207bea19cedc400b65bd8cd2c54ca0faba0 (diff) |
archived old apps that I'm not using
Diffstat (limited to 'app/daily/admin.py')
-rw-r--r-- | app/daily/admin.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/app/daily/admin.py b/app/daily/admin.py deleted file mode 100644 index 32a5747..0000000 --- a/app/daily/admin.py +++ /dev/null @@ -1,55 +0,0 @@ -from django.contrib import admin - -from utils.widgets import LGEntryForm, OLAdminBase -from .models import CheckIn, Daily, Weather - - -class WeatherAdmin(OLAdminBase): - pass - - -class CheckInAdmin(OLAdminBase): - list_display = ('date', 'location') - pass - - -class DailyAdmin(admin.ModelAdmin): - form = LGEntryForm - list_display = ('date', 'user', 'location') - list_filter = ( - 'date', - ('location', admin.RelatedOnlyFieldListFilter), - ) - fieldsets = ( - (None, { - 'fields': ( - 'user', - 'body_markdown', - 'weather_human', - ) - }), - ('Details', { - 'fields': ( - 'location', - 'weather', - 'date' - ), - 'classes': ('collapse',), - }), - ) - - def get_form(self, request, obj=None, **kwargs): - form = super(DailyAdmin, self).get_form(request, **kwargs) - form.current_user = request.user - return form - - def get_queryset(self, request): - qs = super(DailyAdmin, self).get_queryset(request) - if request.user.is_superuser: - return qs - return qs.filter(user=request.user) - - -admin.site.register(CheckIn, CheckInAdmin) -admin.site.register(Weather, WeatherAdmin) -admin.site.register(Daily, DailyAdmin) |