mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-04-29 13:33:44 +03:00
Tweak exception message
This commit is contained in:
parent
e3c3d8826f
commit
d979dc6522
|
@ -420,9 +420,9 @@ class Field(object):
|
||||||
Transform the *outgoing* native value into primitive data.
|
Transform the *outgoing* native value into primitive data.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
'{cls}.to_representation() must be implemented for field {field_name}.\n'
|
'{cls}.to_representation() must be implemented for field '
|
||||||
'If you are upgrading from REST framework version 2 '
|
'{field_name}. If you do not need to support write operations '
|
||||||
'you might want `ReadOnlyField`.'.format(
|
'you probably want to subclass `ReadOnlyField` instead.'.format(
|
||||||
cls=self.__class__.__name__,
|
cls=self.__class__.__name__,
|
||||||
field_name=self.field_name,
|
field_name=self.field_name,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user