Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change fields as decorator documentation for endpoint definitions #128

Open
smholloway opened this issue Jul 3, 2023 · 0 comments
Open

Comments

@smholloway
Copy link
Collaborator

See: https://django-declarative-apis.readthedocs.io/en/latest/fields.html#field-as-decorators-on-a-function

The example for this shows:

@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

But in this example, what exactly is status? I think this should just be if raw_value != True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant