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
commit3f290349aae14dfc5251bca815ee2872454d8c76 (patch)
tree2e3f3a8441870650b9222448b0729ea69daf383a /expo/admin.py
parent504a70f82b9057229611c9b575896c1d172f6158 (diff)
downloadtroggle-3f290349aae14dfc5251bca815ee2872454d8c76.tar.gz
troggle-3f290349aae14dfc5251bca815ee2872454d8c76.tar.bz2
troggle-3f290349aae14dfc5251bca815ee2872454d8c76.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