mirror of https://github.com/snachodog/mybuddy.git
feat: use pill radio and include advanced fields on feeding form
This commit is contained in:
parent
66ccc1c6c8
commit
5ec806ef86
|
@ -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}),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue