From 5ec806ef86a12c0e17fdd748d5e1643179f85cde Mon Sep 17 00:00:00 2001 From: billybonks Date: Wed, 7 Feb 2024 15:18:45 +0800 Subject: [PATCH] feat: use pill radio and include advanced fields on feeding form --- core/forms.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/forms.py b/core/forms.py index 0a98fdcb..97da73f1 100644 --- a/core/forms.py +++ b/core/forms.py @@ -216,6 +216,14 @@ class DiaperChangeForm(CoreModelForm, TaggableModelForm): class FeedingForm(CoreModelForm, TaggableModelForm): + fieldsets = [ + { + "fields": ["child", "start", "end", "type", "method", "amount"], + "layout": "required", + }, + {"layout": "advanced", "fields": ["notes", "tags"]}, + ] + class Meta: model = models.Feeding fields = ["child", "start", "end", "type", "method", "amount", "notes", "tags"] @@ -223,6 +231,8 @@ class FeedingForm(CoreModelForm, TaggableModelForm): "child": ChildRadioSelect, "start": DateTimeInput(), "end": DateTimeInput(), + "type": PillRadioSelect(), + "method": PillRadioSelect(), "notes": forms.Textarea(attrs={"rows": 5}), }