@field(
required=False,
name='completion_status',
type=bool,
default=None,
description='Status for a task in the todo list. The only valid status is "True"')
def status(self, raw_value):
if status.get(raw_value, None) != True:
raise ValueError(f"{raw_value} is not a valid status")
return True
See: https://django-declarative-apis.readthedocs.io/en/latest/fields.html#field-as-decorators-on-a-function
The example for this shows:
But in this example, what exactly is
status? I think this should just beif raw_value != True