@@ -115,9 +115,9 @@ def to_representation(self, value):
115
115
116
116
class PrimaryKeyRelatedField (RelatedField ):
117
117
default_error_messages = {
118
- 'required' : 'This field is required.' ,
119
- 'does_not_exist' : "Invalid pk '{pk_value}' - object does not exist." ,
120
- 'incorrect_type' : 'Incorrect type. Expected pk value, received {data_type}.' ,
118
+ 'required' : _ ( 'This field is required.' ) ,
119
+ 'does_not_exist' : _ ( "Invalid pk '{pk_value}' - object does not exist." ) ,
120
+ 'incorrect_type' : _ ( 'Incorrect type. Expected pk value, received {data_type}.' ) ,
121
121
}
122
122
123
123
def to_internal_value (self , data ):
@@ -162,11 +162,11 @@ class HyperlinkedRelatedField(RelatedField):
162
162
lookup_field = 'pk'
163
163
164
164
default_error_messages = {
165
- 'required' : 'This field is required.' ,
166
- 'no_match' : 'Invalid hyperlink - No URL match' ,
167
- 'incorrect_match' : 'Invalid hyperlink - Incorrect URL match.' ,
168
- 'does_not_exist' : 'Invalid hyperlink - Object does not exist.' ,
169
- 'incorrect_type' : 'Incorrect type. Expected URL string, received {data_type}.' ,
165
+ 'required' : _ ( 'This field is required.' ) ,
166
+ 'no_match' : _ ( 'Invalid hyperlink - No URL match' ) ,
167
+ 'incorrect_match' : _ ( 'Invalid hyperlink - Incorrect URL match.' ) ,
168
+ 'does_not_exist' : _ ( 'Invalid hyperlink - Object does not exist.' ) ,
169
+ 'incorrect_type' : _ ( 'Incorrect type. Expected URL string, received {data_type}.' ) ,
170
170
}
171
171
172
172
def __init__ (self , view_name = None , ** kwargs ):
0 commit comments