Support including raw text fields in the API when using force-text-type.
Review Request #6436 — Created Oct. 14, 2014 and submitted
The
force-text-type=
parameter in requests is useful for returning text
in a different format, but there are times when the client would need
the raw text along with this.Now, the client can also send an
include-raw-text-fields=1
parameter,
which will embed araw_text_fields
dictionary in the object's payload
containing an entry for each text field. Each entry provides the raw
version of the text. This is optional, in order to prevent the default
response from ballooning in size.On an implementation level, this is done by removing all the custom
serializers, and instead adding some metadata to the resource's fields
list for each field that supports text types.MarkdownFieldsMixin
's
serialize_object
then handles embedding these raw fields in the payload
on request.
Tested manually wit and without the new parameter.
Unit tests pass.
Description | From | Last Updated |
---|---|---|
html isn't a valid option for POST/PUT. |
david |
- Change Summary:
-
Clarified the wording for
force-text-type
to make it more clear what will happen to the fields. - Commit:
-
7f5d507312b61ba9f5065786f3b31082567b95271ce708ba4e112c96626247459dfd6d6858a7af79
- Diff:
-
Revision 2 (+138 -56)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/base_comment.py reviewboard/webapi/resources/review_request_draft.py reviewboard/webapi/tests/mixins_comment.py reviewboard/webapi/resources/change.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request_draft.py reviewboard/webapi/tests/mixins_review.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/mixins.py reviewboard/webapi/resources/review_reply.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/base_comment.py reviewboard/webapi/resources/review_request_draft.py reviewboard/webapi/tests/mixins_comment.py reviewboard/webapi/resources/change.py reviewboard/webapi/resources/review_request.py reviewboard/webapi/tests/test_review_request_draft.py reviewboard/webapi/tests/mixins_review.py reviewboard/webapi/resources/base_review.py reviewboard/webapi/mixins.py reviewboard/webapi/resources/review_reply.py