diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-06-18 06:53:52 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-06-18 06:53:52 +0100 |
commit | b4a63eca026a31e0f5471d7b37523e3072e2eb1d (patch) | |
tree | a3382cddd71e966807fb931d6c29a27915cb4aee /expo/admin.py | |
parent | 0306723c950296566ef6c6cf3c3add5b605e9855 (diff) | |
download | troggle-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.py | 11 |
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
|