From aa64972fff49559fbf5fbb92bd391ebdefa8d28d Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 19 Jan 2021 10:06:29 +0100 Subject: [PATCH] more beauty again! replace account codes with long names --- evapp/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/evapp/views.py b/evapp/views.py index c2acc72..66a6fb4 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -89,6 +89,10 @@ class EvaFormView(CookieWizardView): if isinstance(v,collections.abc.Hashable) \ and v in choices}) + # replace values in accounts array from *_CHOICES + data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']] + + # replace keys in data dictionary with verbose_name newdata = {self.instance._meta.get_field(k).verbose_name.title() : v for k,v in data.items()}