From 178c6754725ef7f0b31d591dfc4f2e2e45a14cb7 Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Wed, 10 Jul 2024 14:07:23 -0300 Subject: [PATCH] =?UTF-8?q?Tag=20valueof=20precisa=20trabalhar=20com=20dic?= =?UTF-8?q?ts=20tamb=C3=A9m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/utils/templatetags/sigi_tags.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sigi/apps/utils/templatetags/sigi_tags.py b/sigi/apps/utils/templatetags/sigi_tags.py index e783510..a2e7d31 100644 --- a/sigi/apps/utils/templatetags/sigi_tags.py +++ b/sigi/apps/utils/templatetags/sigi_tags.py @@ -42,6 +42,8 @@ def multiply(value, arg): def valueof(obj, attr_name): if hasattr(obj, attr_name): return getattr(obj, attr_name) + if attr_name in obj: + return obj[attr_name] if isinstance(obj, models.Model): for part in attr_name.split("__"): obj = getattr(obj, part)