Skip to content

Adjust warning to state to move to JSON_API_FORMAT_FIELD_NAMES #507

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

Merged
merged 1 commit into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

ROOT_URLCONF = 'example.urls_test'

JSON_API_FIELD_NAMES = 'camelize'
JSON_API_FORMAT_FIELD_NAMES = 'camelize'
JSON_API_FORMAT_TYPES = 'camelize'
JSON_API_PLURALIZE_TYPES = True

Expand Down
4 changes: 2 additions & 2 deletions rest_framework_json_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def format_keys(obj, format_type=None):

`format_keys` function and `JSON_API_FORMAT_KEYS` setting are deprecated and will be
removed in the future.
Use `format_field_names` and `JSON_API_FIELD_NAMES` instead. Be aware that
Use `format_field_names` and `JSON_API_FORMAT_FIELD_NAMES` instead. Be aware that
`format_field_names` only formats keys and preserves value.

Takes either a dict or list and returns it with camelized keys only if
Expand All @@ -144,7 +144,7 @@ def format_keys(obj, format_type=None):
warnings.warn(
"`format_keys` function and `JSON_API_FORMAT_KEYS` setting are deprecated and will be "
"removed in the future. "
"Use `format_field_names` and `JSON_API_FIELD_NAMES` instead. Be aware that "
"Use `format_field_names` and `JSON_API_FORMAT_FIELD_NAMES` instead. Be aware that "
"`format_field_names` only formats keys and preserves value.",
DeprecationWarning
)
Expand Down