Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fields in table representation #172

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

Open
yasinrawther wants to merge 8 commits into manosim:master
base: master
Choose a base branch
Loading
from yasinrawther:fields-in-table-representation

Conversation

Copy link

@yasinrawther yasinrawther commented Jul 21, 2017

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

soraphis reacted with thumbs up emoji
@@ -122,7 +122,8 @@ def __get_serializer_fields__(self, serializer):
"type": str(field.__class__.__name__),
"sub_fields": sub_fields,
"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

@soraphis soraphis Jan 25, 2018
edited
Loading

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
Author

@yasinrawther yasinrawther Jan 25, 2018

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
Reviewers
1 more reviewer

@soraphis soraphis soraphis left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /