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

Include filter fields' help text as coreapi descriptions #563

Merged
merged 7 commits into from
Nov 17, 2016

Conversation

vil-s
Copy link
Contributor

@vil-s vil-s commented Nov 16, 2016

This will make it a lot simpler to get the parameter descriptions when using DRF and Swagger, as it gets fed in automatically.

compat.coreapi.Field(name=field_name, required=False, location='query')
for field_name in filter_class().filters.keys()
compat.coreapi.Field(
name=field_name, required=False, location='query', description=str(field.field.help_text))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably use six.text_type instead of str.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! We switched to python3 two months ago and I have already forgotten about the whole unicode/str thing.

@carltongibson carltongibson added this to the 1.0 milestone Nov 17, 2016
@carltongibson carltongibson merged commit e7fa698 into carltongibson:develop Nov 17, 2016
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

Successfully merging this pull request may close these issues.

3 participants