From 9e6686b0adc0ddf32d46a5984060eeb7450e015b Mon Sep 17 00:00:00 2001 From: Paul Marillonnet Date: Wed, 14 Mar 2018 17:40:15 +0100 Subject: [PATCH] WIP configure displayed columns (#22470) --- fargo/fargo/tables.py | 6 +++++- fargo/settings.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fargo/fargo/tables.py b/fargo/fargo/tables.py index 1a3ab42..e36a4be 100644 --- a/fargo/fargo/tables.py +++ b/fargo/fargo/tables.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.utils.translation import ugettext_lazy as _ import django_tables2 as tables @@ -11,8 +12,11 @@ class DocumentTable(tables.Table): orderable=False, verbose_name=_('size').title()) created = tables.DateTimeColumn(verbose_name=_('creation date').title()) + expiration_date = tables.DateTimeColumn(verbose_name=_('Expiration')) + origin = tables.Column(verbose_name=_('Origin'), accessor="Origin.label") class Meta: model = models.Document - fields = ('size', 'created') + fields = settings.FARGO_TABLE_COLUMNS + sequence = settings.FARGO_TABLE_COLUMNS empty_text = _('You currently have no documents') diff --git a/fargo/settings.py b/fargo/settings.py index d06d23b..080cde9 100644 --- a/fargo/settings.py +++ b/fargo/settings.py @@ -155,6 +155,8 @@ FARGO_MAX_DOCUMENT_BOX_SIZE = 20 * 1024 * 1024 # 20 Mo FARGO_VALIDATION_LIFETIME = 3600 * 24 * 31 * 6 # nearly 6 months +FARGO_TABLE_COLUMNS = ('origin', 'expiration_date') + FARGO_DOCUMENT_TYPES = [ { 'name': 'avis-d-imposition', -- 2.16.2