summaryrefslogtreecommitdiffstats
path: root/expo/admin.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-06-18 06:53:52 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-06-18 06:53:52 +0100
commitb4a63eca026a31e0f5471d7b37523e3072e2eb1d (patch)
treea3382cddd71e966807fb931d6c29a27915cb4aee /expo/admin.py
parent0306723c950296566ef6c6cf3c3add5b605e9855 (diff)
downloadtroggle-b4a63eca026a31e0f5471d7b37523e3072e2eb1d.tar.gz
troggle-b4a63eca026a31e0f5471d7b37523e3072e2eb1d.tar.bz2
troggle-b4a63eca026a31e0f5471d7b37523e3072e2eb1d.zip
[svn] Adding logbook export features. Troggle can now produce .txt or .html logbooks through the controlPanel or via an action in the LogbookEntry admin pages.
Diffstat (limited to 'expo/admin.py')
-rw-r--r--expo/admin.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/expo/admin.py b/expo/admin.py
index e4863b1..e88e1cd 100644
--- a/expo/admin.py
+++ b/expo/admin.py
@@ -6,6 +6,7 @@ import django.forms as forms
from expo.forms import LogbookEntryForm
from django.http import HttpResponse
from django.core import serializers
+from expo.views_other import downloadLogbook
#from troggle.reversion.admin import VersionAdmin #django-reversion version control
#overriding admin save so we have the new since parsing field
@@ -50,6 +51,16 @@ class LogbookEntryAdmin(TroggleModelAdmin):
date_heirarchy = ('date')
inlines = (PersonTripInline, PhotoInline, QMsFoundInline)
form = LogbookEntryForm
+
+ actions=('export_logbook_entries_as_html','export_logbook_entries_as_txt')
+
+ def export_logbook_entries_as_html(modeladmin, request, queryset):
+ response=downloadLogbook(request=request, queryset=queryset, extension='html')
+ return response
+
+ def export_logbook_entries_as_txt(modeladmin, request, queryset):
+ response=downloadLogbook(request=request, queryset=queryset, extension='txt')
+ return response
class PersonExpeditionInline(admin.TabularInline):
model = PersonExpedition