Allow and default to NULL Sleep.nap via API

Fixes #657
This commit is contained in:
Christopher C. Wells 2023-06-14 20:01:49 -07:00
parent 4263e4809b
commit 759bbe9ddb
1 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,8 @@ class NoteSerializer(CoreModelSerializer, TaggableSerializer):
class SleepSerializer(CoreModelWithDurationSerializer, TaggableSerializer): class SleepSerializer(CoreModelWithDurationSerializer, TaggableSerializer):
nap = serializers.BooleanField(allow_null=True, default=None, required=False)
class Meta(CoreModelWithDurationSerializer.Meta): class Meta(CoreModelWithDurationSerializer.Meta):
model = models.Sleep model = models.Sleep
fields = ( fields = (