Skip to content

Commit bc6ecea

Browse files
committed
additionally fetch the max_length field to render in table
1 parent 94571d0 commit bc6ecea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework_docs/api_endpoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def __get_serializer_fields__(self, serializer):
122122
"type": str(field.__class__.__name__),
123123
"sub_fields": sub_fields,
124124
"required": field.required,
125-
"to_many_relation": to_many_relation
125+
"to_many_relation": to_many_relation,
126+
"max_length": (field.__dict__.get('max_length', '-') if field.__dict__.get('max_length', '-') != None else '-')
126127
})
127128
# FIXME:
128129
# Show more attibutes of `field`?

0 commit comments

Comments
 (0)