diff --git a/core/forms.py b/core/forms.py index 15acc73b..3fffaf2c 100644 --- a/core/forms.py +++ b/core/forms.py @@ -157,8 +157,7 @@ class PumpingForm(CoreModelForm): class DiaperChangeForm(CoreModelForm, TaggableModelForm): class Meta: model = models.DiaperChange - fields = ["child", "time", "wet", "solid", "color", "amount", "notes", - "tags"] + fields = ["child", "time", "wet", "solid", "color", "amount", "notes", "tags"] widgets = { "child": ChildRadioSelect(), "time": forms.DateTimeInput( @@ -174,8 +173,7 @@ class DiaperChangeForm(CoreModelForm, TaggableModelForm): class FeedingForm(CoreModelForm, TaggableModelForm): class Meta: model = models.Feeding - fields = ["child", "start", "end", "type", "method", "amount", "notes", - "tags"] + fields = ["child", "start", "end", "type", "method", "amount", "notes", "tags"] widgets = { "child": ChildRadioSelect, "start": forms.DateTimeInput( @@ -205,7 +203,7 @@ class NoteForm(CoreModelForm, TaggableModelForm): "autocomplete": "off", "data-target": "#datetimepicker_time", } - ) + ), } @@ -248,7 +246,6 @@ class TemperatureForm(CoreModelForm, TaggableModelForm): class TimerForm(CoreModelForm): - class Meta: model = models.Timer fields = ["child", "name", "start"] @@ -259,7 +256,7 @@ class TimerForm(CoreModelForm): "autocomplete": "off", "data-target": "#datetimepicker_start", } - ) + ), } def __init__(self, *args, **kwargs): diff --git a/core/widgets.py b/core/widgets.py index de2383fc..7f708cbf 100644 --- a/core/widgets.py +++ b/core/widgets.py @@ -88,8 +88,12 @@ class ChildRadioSelect(RadioSelect): template_name = "core/child_radio.html" option_template_name = "core/child_radio_option.html" - def create_option(self, name, value, label, selected, index, subindex=None, attrs=None): - option = super().create_option(name, value, label, selected, index, subindex, attrs) - if value != '': - option['picture'] = value.instance.picture + def create_option( + self, name, value, label, selected, index, subindex=None, attrs=None + ): + option = super().create_option( + name, value, label, selected, index, subindex, attrs + ) + if value != "": + option["picture"] = value.instance.picture return option