From 04220f48ac183342a78f23a2bbe79d1be7a08bc1 Mon Sep 17 00:00:00 2001 From: relnod Date: Sun, 12 Mar 2017 18:44:00 +0100 Subject: [PATCH] add material description --- jdav_web/material/admin.py | 2 +- jdav_web/material/models.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jdav_web/material/admin.py b/jdav_web/material/admin.py index 0771630..87b1dd8 100644 --- a/jdav_web/material/admin.py +++ b/jdav_web/material/admin.py @@ -36,7 +36,7 @@ class NotTooOldFilter(SimpleListFilter): class MaterialAdmin(admin.ModelAdmin): """Edit view of a MaterialPart""" - list_display = ('name', 'quantity_real', 'buy_date', 'lifetime', 'not_too_old', 'photo') + list_display = ('name', 'description', 'quantity_real', 'buy_date', 'lifetime', 'not_too_old', 'photo') inlines = [OwnershipInline] list_filter = (NotTooOldFilter,) diff --git a/jdav_web/material/models.py b/jdav_web/material/models.py index 3e59978..e9ba04f 100644 --- a/jdav_web/material/models.py +++ b/jdav_web/material/models.py @@ -15,6 +15,7 @@ class MaterialPart(models.Model): members of the association (Ownership) """ name = models.CharField(_('name'), max_length=30) + description = models.CharField(_('description'), default='', max_length=140) quantity = models.IntegerField(_('quantity'), default=0) buy_date = models.DateField(_('purchase date'), editable=True) lifetime = models.DecimalField(_('lifetime (years)'), decimal_places=0, max_digits=3)