diff --git a/api/serializers.py b/api/serializers.py index 794a99fe..ae2b5700 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -126,7 +126,15 @@ class PumpingSerializer(CoreModelSerializer, TaggableSerializer): class ChildSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = models.Child - fields = ("id", "first_name", "last_name", "birth_date", "slug", "picture") + fields = ( + "id", + "first_name", + "last_name", + "birth_date", + "birth_time", + "slug", + "picture", + ) lookup_field = "slug" diff --git a/api/tests.py b/api/tests.py index d6d922da..c6a5d6b9 100644 --- a/api/tests.py +++ b/api/tests.py @@ -139,13 +139,19 @@ class ChildAPITestCase(TestBase.BabyBuddyAPITestCaseBase): "first_name": "Fake", "last_name": "Child", "birth_date": "2017-11-11", + "birth_time": None, "slug": "fake-child", "picture": None, }, ) def test_post(self): - data = {"first_name": "Test", "last_name": "Child", "birth_date": "2017-11-12"} + data = { + "first_name": "Test", + "last_name": "Child", + "birth_date": "2017-11-12", + "birth_time": "23:25", + } response = self.client.post(self.endpoint, data, format="json") self.assertEqual(response.status_code, status.HTTP_201_CREATED) obj = models.Child.objects.get(pk=response.data["id"]) diff --git a/api/views.py b/api/views.py index 44e93672..3f52149c 100644 --- a/api/views.py +++ b/api/views.py @@ -33,9 +33,16 @@ class ChildViewSet(viewsets.ModelViewSet): queryset = models.Child.objects.all() serializer_class = serializers.ChildSerializer lookup_field = "slug" - filterset_fields = ("id", "first_name", "last_name", "slug", "birth_date") - ordering_fields = ("birth_date", "first_name", "last_name", "slug") - ordering = "-birth_date" + filterset_fields = ( + "id", + "first_name", + "last_name", + "slug", + "birth_date", + "birth_time", + ) + ordering_fields = ("birth_date", "birth_time", "first_name", "last_name", "slug") + ordering = ["-birth_date", "-birth_time"] class DiaperChangeViewSet(viewsets.ModelViewSet): diff --git a/core/admin.py b/core/admin.py index 621c125c..9e661446 100644 --- a/core/admin.py +++ b/core/admin.py @@ -49,10 +49,10 @@ class ChildImportExportResource(resources.ModelResource): @admin.register(models.Child) class ChildAdmin(ImportExportMixin, ExportActionMixin, admin.ModelAdmin): - list_display = ("first_name", "last_name", "birth_date", "slug") + list_display = ("first_name", "last_name", "birth_date", "birth_time", "slug") list_filter = ("last_name",) search_fields = ("first_name", "last_name", "birth_date") - fields = ["first_name", "last_name", "birth_date"] + fields = ["first_name", "last_name", "birth_date", "birth_time"] if settings.BABY_BUDDY["ALLOW_UPLOADS"]: fields.append("picture") resource_class = ChildImportExportResource diff --git a/core/forms.py b/core/forms.py index 3c11f832..03ca1440 100644 --- a/core/forms.py +++ b/core/forms.py @@ -7,7 +7,7 @@ from django.utils.translation import gettext_lazy as _ from taggit.forms import TagField -from babybuddy.widgets import DateInput, DateTimeInput +from babybuddy.widgets import DateInput, DateTimeInput, TimeInput from core import models from core.widgets import TagsEditor, ChildRadioSelect @@ -107,11 +107,12 @@ class CoreModelForm(forms.ModelForm): class ChildForm(forms.ModelForm): class Meta: model = models.Child - fields = ["first_name", "last_name", "birth_date"] + fields = ["first_name", "last_name", "birth_date", "birth_time"] if settings.BABY_BUDDY["ALLOW_UPLOADS"]: fields.append("picture") widgets = { "birth_date": DateInput(), + "birth_time": TimeInput(), } diff --git a/core/migrations/0032_child_birth_time.py b/core/migrations/0032_child_birth_time.py new file mode 100644 index 00000000..3963d533 --- /dev/null +++ b/core/migrations/0032_child_birth_time.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-10-21 17:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("core", "0031_note_image"), + ] + + operations = [ + migrations.AddField( + model_name="child", + name="birth_time", + field=models.TimeField(blank=True, null=True, verbose_name="Birth time"), + ), + ] diff --git a/core/models.py b/core/models.py index 0b53d588..e4127563 100644 --- a/core/models.py +++ b/core/models.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import datetime import re from datetime import timedelta @@ -165,6 +166,7 @@ class Child(models.Model): blank=True, max_length=255, verbose_name=_("Last name") ) birth_date = models.DateField(blank=False, null=False, verbose_name=_("Birth date")) + birth_time = models.TimeField(blank=True, null=True, verbose_name=_("Birth time")) slug = models.SlugField( allow_unicode=True, blank=False, @@ -206,6 +208,13 @@ class Child(models.Model): return "{}, {}".format(self.last_name, self.first_name) return "{} {}".format(self.first_name, self.last_name) + def birth_datetime(self): + if self.birth_time: + return timezone.make_aware( + datetime.datetime.combine(self.birth_date, self.birth_time) + ) + return self.birth_date + @classmethod def count(cls): """Get a (cached) count of total number of Child instances.""" diff --git a/core/templates/core/child_detail.html b/core/templates/core/child_detail.html index 84db3dda..88cebe57 100644 --- a/core/templates/core/child_detail.html +++ b/core/templates/core/child_detail.html @@ -22,8 +22,8 @@ {% endif %}
{{ object }}

- {% trans "Born" %} {{ object.birth_date }}
- {% trans "Age" %} {{ object.birth_date|child_age_string }} + {% trans "Born" %} {{ object.birth_datetime }}
+ {% trans "Age" %} {{ object.birth_datetime|child_age_string }}

{% include 'dashboard/child_button_group.html' %} diff --git a/core/templates/core/child_list.html b/core/templates/core/child_list.html index ed944b3e..6a529c07 100644 --- a/core/templates/core/child_list.html +++ b/core/templates/core/child_list.html @@ -42,7 +42,7 @@ {{ child.first_name }} {{ child.last_name }} - {{ child.birth_date }} + {{ child.birth_datetime }}
diff --git a/core/templatetags/duration.py b/core/templatetags/duration.py index 1fec5177..9d3cc8fd 100644 --- a/core/templatetags/duration.py +++ b/core/templatetags/duration.py @@ -20,9 +20,6 @@ def child_age_string(birth_date): """ if not birth_date: return "" - # Return "0 days" for anything under one day. - elif timezone.localdate() - birth_date < timezone.timedelta(days=1): - return _("0 days") try: return timesince.timesince(birth_date, depth=1) except (ValueError, TypeError): diff --git a/core/tests/import/child.csv b/core/tests/import/child.csv index 1f1ddeee..e54e2f7f 100644 --- a/core/tests/import/child.csv +++ b/core/tests/import/child.csv @@ -1,2 +1,2 @@ -first_name,last_name,birth_date -Emily,Huerta,2020-01-17 +first_name,last_name,birth_date,birth_time +Emily,Huerta,2020-01-17,10:21 diff --git a/core/tests/tests_templatetags.py b/core/tests/tests_templatetags.py index 99f41a0f..9edc137b 100644 --- a/core/tests/tests_templatetags.py +++ b/core/tests/tests_templatetags.py @@ -24,8 +24,8 @@ class TemplateTagsTestCase(TestCase): ) def test_child_age_string(self): - date = timezone.localdate() - timezone.timedelta(days=0, hours=6) - self.assertEqual("0 days", duration.child_age_string(date)) + date = timezone.localtime() - timezone.timedelta(days=0, hours=6) + self.assertEqual("6\xa0hours", duration.child_age_string(date)) date = timezone.localdate() - timezone.timedelta(days=1, hours=6) self.assertEqual("1\xa0day", duration.child_age_string(date)) date = timezone.localdate() - timezone.timedelta(days=45) diff --git a/openapi-schema.yml b/openapi-schema.yml index 25b46c4d..4224c2e2 100644 --- a/openapi-schema.yml +++ b/openapi-schema.yml @@ -1,8 +1,7 @@ openapi: 3.0.2 info: - title: Baby Buddy API - version: 1 - description: API documentation for the Baby Buddy application + title: '' + version: '' paths: /api/bmi/: get: @@ -128,6 +127,54 @@ paths: description: '' tags: - api + put: + operationId: updateBMI + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this BMI. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: date + required: false + in: query + description: date + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BMI' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/BMI' + multipart/form-data: + schema: + $ref: '#/components/schemas/BMI' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BMI' + description: '' + tags: + - api patch: operationId: partialUpdateBMI description: '' @@ -427,6 +474,101 @@ paths: description: '' tags: - api + put: + operationId: updateDiaperChange + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Diaper Change. + schema: + type: string + - name: amount + required: false + in: query + description: amount + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: color + required: false + in: query + description: color + schema: + type: string + enum: + - black + - brown + - green + - yellow + - name: date + required: false + in: query + description: DateTime + schema: + type: string + - name: date_max + required: false + in: query + description: Max. DateTime + schema: + type: string + - name: date_min + required: false + in: query + description: Min. DateTime + schema: + type: string + - name: solid + required: false + in: query + description: solid + schema: + type: string + - name: wet + required: false + in: query + description: wet + schema: + type: string + - name: tags + required: false + in: query + description: tag + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiaperChange' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/DiaperChange' + multipart/form-data: + schema: + $ref: '#/components/schemas/DiaperChange' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DiaperChange' + description: '' + tags: + - api patch: operationId: partialUpdateDiaperChange description: '' @@ -649,6 +791,12 @@ paths: description: birth_date schema: type: string + - name: birth_time + required: false + in: query + description: birth_time + schema: + type: string - name: ordering required: false in: query @@ -747,6 +895,12 @@ paths: description: birth_date schema: type: string + - name: birth_time + required: false + in: query + description: birth_time + schema: + type: string - name: ordering required: false in: query @@ -762,6 +916,78 @@ paths: description: '' tags: - api + put: + operationId: updateChild + description: '' + parameters: + - name: slug + in: path + required: true + description: '' + schema: + type: string + - name: id + required: false + in: query + description: id + schema: + type: string + - name: first_name + required: false + in: query + description: first_name + schema: + type: string + - name: last_name + required: false + in: query + description: last_name + schema: + type: string + - name: slug + required: false + in: query + description: slug + schema: + type: string + - name: birth_date + required: false + in: query + description: birth_date + schema: + type: string + - name: birth_time + required: false + in: query + description: birth_time + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Child' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Child' + multipart/form-data: + schema: + $ref: '#/components/schemas/Child' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Child' + description: '' + tags: + - api patch: operationId: partialUpdateChild description: '' @@ -802,6 +1028,12 @@ paths: description: birth_date schema: type: string + - name: birth_time + required: false + in: query + description: birth_time + schema: + type: string - name: ordering required: false in: query @@ -868,6 +1100,12 @@ paths: description: birth_date schema: type: string + - name: birth_time + required: false + in: query + description: birth_time + schema: + type: string - name: ordering required: false in: query @@ -1123,6 +1361,114 @@ paths: description: '' tags: - api + put: + operationId: updateFeeding + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Feeding. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: end + required: false + in: query + description: End DateTime + schema: + type: string + - name: end_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: end_min + required: false + in: query + description: Min. End DateTime + schema: + type: string + - name: method + required: false + in: query + description: method + schema: + type: string + enum: + - bottle + - left breast + - right breast + - both breasts + - parent fed + - self fed + - name: start + required: false + in: query + description: Start DateTime + schema: + type: string + - name: start_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: start_min + required: false + in: query + description: Min. Start DateTime + schema: + type: string + - name: type + required: false + in: query + description: type + schema: + type: string + enum: + - breast milk + - formula + - fortified breast milk + - solid food + - name: tags + required: false + in: query + description: tag + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Feeding' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Feeding' + multipart/form-data: + schema: + $ref: '#/components/schemas/Feeding' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Feeding' + description: '' + tags: + - api patch: operationId: partialUpdateFeeding description: '' @@ -1448,6 +1794,54 @@ paths: description: '' tags: - api + put: + operationId: updateHeadCircumference + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Head Circumference. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: date + required: false + in: query + description: date + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HeadCircumference' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/HeadCircumference' + multipart/form-data: + schema: + $ref: '#/components/schemas/HeadCircumference' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HeadCircumference' + description: '' + tags: + - api patch: operationId: partialUpdateHeadCircumference description: '' @@ -1653,6 +2047,54 @@ paths: description: '' tags: - api + put: + operationId: updateHeight + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Height. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: date + required: false + in: query + description: date + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Height' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Height' + multipart/form-data: + schema: + $ref: '#/components/schemas/Height' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Height' + description: '' + tags: + - api patch: operationId: partialUpdateHeight description: '' @@ -1894,6 +2336,72 @@ paths: description: '' tags: - api + put: + operationId: updateNote + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Note. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: date + required: false + in: query + description: DateTime + schema: + type: string + - name: date_max + required: false + in: query + description: Max. DateTime + schema: + type: string + - name: date_min + required: false + in: query + description: Min. DateTime + schema: + type: string + - name: tags + required: false + in: query + description: tag + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Note' + multipart/form-data: + schema: + $ref: '#/components/schemas/Note' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + description: '' + tags: + - api patch: operationId: partialUpdateNote description: '' @@ -2195,6 +2703,84 @@ paths: description: '' tags: - api + put: + operationId: updatePumping + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Pumping. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: end + required: false + in: query + description: End DateTime + schema: + type: string + - name: end_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: end_min + required: false + in: query + description: Min. End DateTime + schema: + type: string + - name: start + required: false + in: query + description: Start DateTime + schema: + type: string + - name: start_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: start_min + required: false + in: query + description: Min. Start DateTime + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pumping' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Pumping' + multipart/form-data: + schema: + $ref: '#/components/schemas/Pumping' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Pumping' + description: '' + tags: + - api patch: operationId: partialUpdatePumping description: '' @@ -2532,6 +3118,90 @@ paths: description: '' tags: - api + put: + operationId: updateSleep + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Sleep. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: end + required: false + in: query + description: End DateTime + schema: + type: string + - name: end_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: end_min + required: false + in: query + description: Min. End DateTime + schema: + type: string + - name: start + required: false + in: query + description: Start DateTime + schema: + type: string + - name: start_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: start_min + required: false + in: query + description: Min. Start DateTime + schema: + type: string + - name: tags + required: false + in: query + description: tag + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Sleep' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Sleep' + multipart/form-data: + schema: + $ref: '#/components/schemas/Sleep' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Sleep' + description: '' + tags: + - api patch: operationId: partialUpdateSleep description: '' @@ -2809,6 +3479,54 @@ paths: description: '' tags: - api + put: + operationId: updateTag + description: '' + parameters: + - name: slug + in: path + required: true + description: '' + schema: + type: string + - name: last_used + required: false + in: query + description: last_used + schema: + type: string + - name: name + required: false + in: query + description: name + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Tag' + multipart/form-data: + schema: + $ref: '#/components/schemas/Tag' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + description: '' + tags: + - api patch: operationId: partialUpdateTag description: '' @@ -3050,6 +3768,72 @@ paths: description: '' tags: - api + put: + operationId: updateTemperature + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Temperature. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: date + required: false + in: query + description: DateTime + schema: + type: string + - name: date_max + required: false + in: query + description: Max. DateTime + schema: + type: string + - name: date_min + required: false + in: query + description: Min. DateTime + schema: + type: string + - name: tags + required: false + in: query + description: tag + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Temperature' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Temperature' + multipart/form-data: + schema: + $ref: '#/components/schemas/Temperature' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Temperature' + description: '' + tags: + - api patch: operationId: partialUpdateTemperature description: '' @@ -3208,6 +3992,12 @@ paths: description: Min. End DateTime schema: type: string + - name: name + required: false + in: query + description: name + schema: + type: string - name: start required: false in: query @@ -3324,6 +4114,12 @@ paths: description: Min. End DateTime schema: type: string + - name: name + required: false + in: query + description: name + schema: + type: string - name: start required: false in: query @@ -3363,6 +4159,96 @@ paths: description: '' tags: - api + put: + operationId: updateTimer + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Timer. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: end + required: false + in: query + description: End DateTime + schema: + type: string + - name: end_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: end_min + required: false + in: query + description: Min. End DateTime + schema: + type: string + - name: name + required: false + in: query + description: name + schema: + type: string + - name: start + required: false + in: query + description: Start DateTime + schema: + type: string + - name: start_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: start_min + required: false + in: query + description: Min. Start DateTime + schema: + type: string + - name: user + required: false + in: query + description: user + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Timer' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Timer' + multipart/form-data: + schema: + $ref: '#/components/schemas/Timer' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Timer' + description: '' + tags: + - api patch: operationId: partialUpdateTimer description: '' @@ -3397,6 +4283,12 @@ paths: description: Min. End DateTime schema: type: string + - name: name + required: false + in: query + description: name + schema: + type: string - name: start required: false in: query @@ -3481,6 +4373,12 @@ paths: description: Min. End DateTime schema: type: string + - name: name + required: false + in: query + description: name + schema: + type: string - name: start required: false in: query @@ -3712,6 +4610,90 @@ paths: description: '' tags: - api + put: + operationId: updateTummyTime + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Tummy Time. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: end + required: false + in: query + description: End DateTime + schema: + type: string + - name: end_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: end_min + required: false + in: query + description: Min. End DateTime + schema: + type: string + - name: start + required: false + in: query + description: Start DateTime + schema: + type: string + - name: start_max + required: false + in: query + description: Max. End DateTime + schema: + type: string + - name: start_min + required: false + in: query + description: Min. Start DateTime + schema: + type: string + - name: tags + required: false + in: query + description: tag + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TummyTime' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/TummyTime' + multipart/form-data: + schema: + $ref: '#/components/schemas/TummyTime' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TummyTime' + description: '' + tags: + - api patch: operationId: partialUpdateTummyTime description: '' @@ -3989,6 +4971,54 @@ paths: description: '' tags: - api + put: + operationId: updateWeight + description: '' + parameters: + - name: id + in: path + required: true + description: A unique integer value identifying this Weight. + schema: + type: string + - name: child + required: false + in: query + description: child + schema: + type: string + - name: date + required: false + in: query + description: date + schema: + type: string + - name: ordering + required: false + in: query + description: Which field to use when ordering the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Weight' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Weight' + multipart/form-data: + schema: + $ref: '#/components/schemas/Weight' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Weight' + description: '' + tags: + - api patch: operationId: partialUpdateWeight description: '' @@ -4190,6 +5220,9 @@ components: birth_date: type: string format: date + birth_time: + type: string + nullable: true slug: type: string readOnly: true @@ -4313,6 +5346,10 @@ components: type: integer note: type: string + image: + type: string + format: binary + nullable: true time: type: string format: date-time @@ -4511,4 +5548,4 @@ components: type: string required: - child - - weight \ No newline at end of file + - weight