Projet

Général

Profil

0001-WIP-configure-displayed-columns-22470.patch

Paul Marillonnet, 15 mars 2018 18:24

Télécharger (1,65 ko)

Voir les différences:

Subject: [PATCH] WIP configure displayed columns (#22470)

 fargo/fargo/tables.py | 6 +++++-
 fargo/settings.py     | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)
fargo/fargo/tables.py
1
from django.conf import settings
1 2
from django.utils.translation import ugettext_lazy as _
2 3

  
3 4
import django_tables2 as tables
......
11 12
                                 orderable=False,
12 13
                                 verbose_name=_('size').title())
13 14
    created = tables.DateTimeColumn(verbose_name=_('creation date').title())
15
    expiration_date = tables.DateTimeColumn(verbose_name=_('Expiration'))
16
    origin = tables.Column(verbose_name=_('Origin'), accessor="Origin.label")
14 17

  
15 18
    class Meta:
16 19
        model = models.Document
17
        fields = ('size', 'created')
20
        fields = settings.FARGO_TABLE_COLUMNS
21
        sequence = settings.FARGO_TABLE_COLUMNS
18 22
        empty_text = _('You currently have no documents')
fargo/settings.py
155 155

  
156 156
FARGO_VALIDATION_LIFETIME = 3600 * 24 * 31 * 6  # nearly 6 months
157 157

  
158
FARGO_TABLE_COLUMNS = ('origin', 'expiration_date')
159

  
158 160
FARGO_DOCUMENT_TYPES = [
159 161
    {
160 162
        'name': 'avis-d-imposition',
161
-