From af0d448f04240594f07ef2b67d3e3e4ed265677b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Sun, 26 Nov 2023 16:54:14 +0100 Subject: [PATCH] Hide widget instead of deleting it fixes #4 --- dynamic_forms/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic_forms/__init__.py b/dynamic_forms/__init__.py index 6cf9a37..9276152 100644 --- a/dynamic_forms/__init__.py +++ b/dynamic_forms/__init__.py @@ -35,4 +35,4 @@ def __init__(self, *args, **kwargs): if field.should_be_included(self): self.fields[name] = field.make_real_field(self) else: - del self.fields[name] + self.fields[name].widget = forms.HiddenInput()