forked from versae/qbe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
19,377 additions
and
1,351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from django import forms | ||
from django.contrib import admin | ||
from import_export.admin import ImportExportModelAdmin | ||
from ordered_model.admin import OrderedModelAdmin | ||
|
||
from .models import SavedReport | ||
|
||
|
||
class SavedReportForm(forms.ModelForm): | ||
model = SavedReport | ||
|
||
|
||
class SavedReportAdmin(ImportExportModelAdmin, OrderedModelAdmin): | ||
form = SavedReportForm | ||
fields = [str(f).split('.')[-1] for f in SavedReport._meta.get_fields() if f.name not in ['id', 'order']] | ||
list_display = ['title', 'description', 'report_type', 'move_up_down_links', 'created', 'modified'] | ||
readonly_fields = ['created', 'modified'] | ||
list_filter = ['report_type'] | ||
|
||
def save_form(self, request, form, change): | ||
return super(SavedReportAdmin, self).save_form(request, form, change) | ||
|
||
|
||
admin.site.register(SavedReport, SavedReportAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.