Skip to content

Fields in table representation#172

Open
yasinrawther wants to merge 8 commits into
manosim:masterfrom
yasinrawther:fields-in-table-representation
Open

Fields in table representation#172
yasinrawther wants to merge 8 commits into
manosim:masterfrom
yasinrawther:fields-in-table-representation

Conversation

@yasinrawther
Copy link
Copy Markdown

Here I have added the feature of fields with the table representation. So you can use Table representation to make your fields list in the documentation clear. So We can change representation by adding single line inside the REST_FRAMEWORK_DOCS in settings.py. And also show max_length field in table representation. Sample output I attached here.
fields_table_repr

Comment thread rest_framework_docs/api_endpoint.py Outdated
"required": field.required,
"to_many_relation": to_many_relation
"to_many_relation": to_many_relation,
"max_length": (field.__dict__.get('max_length', '-') if field.__dict__.get('max_length', '-') != None else '-')
Copy link
Copy Markdown

@soraphis soraphis Jan 25, 2018

Choose a reason for hiding this comment

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

change:

if field.__dict__.get('max_length', '-') != None else '-')

to

if field.__dict__.get('max_length', '-') is not None else '-')

(to fulfill flake8 requirements)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Committed the changes for flake8 requirements

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.

2 participants