mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 11:33:59 +03:00
Merge pull request #3071 from antonyc/patch-1
Made exception message more verbose
This commit is contained in:
commit
e3c3d8826f
|
@ -420,10 +420,11 @@ class Field(object):
|
|||
Transform the *outgoing* native value into primitive data.
|
||||
"""
|
||||
raise NotImplementedError(
|
||||
'{cls}.to_representation() must be implemented.\n'
|
||||
'{cls}.to_representation() must be implemented for field {field_name}.\n'
|
||||
'If you are upgrading from REST framework version 2 '
|
||||
'you might want `ReadOnlyField`.'.format(
|
||||
cls=self.__class__.__name__
|
||||
cls=self.__class__.__name__,
|
||||
field_name=self.field_name,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user