diff options
Diffstat (limited to 'core/admin.py')
-rw-r--r-- | core/admin.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/admin.py b/core/admin.py index 0b7cf13..c5a1484 100644 --- a/core/admin.py +++ b/core/admin.py @@ -9,12 +9,12 @@ from troggle.core.views_other import downloadLogbook class TroggleModelAdmin(admin.ModelAdmin): - + def save_model(self, request, obj, form, change): """overriding admin save to fill the new_since parsing_field""" obj.new_since_parsing=True obj.save() - + class Media: js = ('jquery/jquery.min.js','js/QM_helper.js') @@ -44,7 +44,7 @@ class OtherCaveInline(admin.TabularInline): class SurveyAdmin(TroggleModelAdmin): inlines = (ScannedImageInline,) - search_fields = ('expedition__year','wallet_number') + search_fields = ('expedition__year','wallet_number') class QMsFoundInline(admin.TabularInline): @@ -52,7 +52,7 @@ class QMsFoundInline(admin.TabularInline): fk_name='found_by' fields=('number','grade','location_description','comment')#need to add foreignkey to cave part extra=1 - + class PhotoInline(admin.TabularInline): model = DPhoto @@ -68,7 +68,7 @@ class PersonTripInline(admin.TabularInline): #class LogbookEntryAdmin(VersionAdmin): class LogbookEntryAdmin(TroggleModelAdmin): - prepopulated_fields = {'slug':("title",)} + prepopulated_fields = {'slug':("title",)} search_fields = ('title','expedition__year') date_heirarchy = ('date') inlines = (PersonTripInline, PhotoInline, QMsFoundInline) @@ -77,11 +77,11 @@ class LogbookEntryAdmin(TroggleModelAdmin): "all": ("css/troggleadmin.css",) } actions=('export_logbook_entries_as_html','export_logbook_entries_as_txt') - + def export_logbook_entries_as_html(self, modeladmin, request, queryset): response=downloadLogbook(request=request, queryset=queryset, extension='html') return response - + def export_logbook_entries_as_txt(self, modeladmin, request, queryset): response=downloadLogbook(request=request, queryset=queryset, extension='txt') return response |