From f3ec0836f894129d8c7d7efb9a25ad8b97608412 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sun, 23 Feb 2020 16:48:35 +0100 Subject: [PATCH] add display field to TransactionTemplate --- apps/note/admin.py | 4 ++-- apps/note/models/transactions.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/note/admin.py b/apps/note/admin.py index 3a9721ae..0aa3be39 100644 --- a/apps/note/admin.py +++ b/apps/note/admin.py @@ -141,8 +141,8 @@ class TransactionTemplateAdmin(admin.ModelAdmin): """ Admin customisation for TransactionTemplate """ - list_display = ('name', 'poly_destination', 'amount', 'template_type') - list_filter = ('template_type', ) + list_display = ('name', 'poly_destination', 'amount', 'category', 'display', ) + list_filter = ('category', 'display') autocomplete_fields = ('destination', ) def poly_destination(self, obj): diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index 4db2eda1..043cbbe9 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -54,13 +54,15 @@ class TransactionTemplate(models.Model): verbose_name=_('amount'), help_text=_('in centimes'), ) - template_type = models.ForeignKey( + category = models.ForeignKey( TransactionCategory, on_delete=models.PROTECT, verbose_name=_('type'), max_length=31, ) - + display = models.BooleanField( + default = True, + ) description = models.CharField( verbose_name=_('description'), max_length=255,